From f3e670e9341decac613d33fc52febf19cea32f20 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Nov 2021 17:38:10 +0000 Subject: [PATCH] Update auto-generated bindings --- src/main/java/org/ldk/enums/AccessError.java | 6 + .../ldk/enums/ChannelMonitorUpdateErr.java | 62 + .../org/ldk/enums/ConfirmationTarget.java | 9 + .../java/org/ldk/enums/CreationError.java | 12 + src/main/java/org/ldk/enums/Currency.java | 15 + src/main/java/org/ldk/enums/Level.java | 15 + src/main/java/org/ldk/enums/Network.java | 12 + .../java/org/ldk/enums/Secp256k1Error.java | 27 + .../java/org/ldk/enums/SemanticError.java | 31 + src/main/java/org/ldk/enums/SiPrefix.java | 12 + src/main/java/org/ldk/impl/bindings.java | 1237 ++- src/main/java/org/ldk/structs/APIError.java | 37 + .../java/org/ldk/structs/AcceptChannel.java | 19 +- src/main/java/org/ldk/structs/Access.java | 4 +- .../ldk/structs/AnnouncementSignatures.java | 13 +- src/main/java/org/ldk/structs/Balance.java | 28 + src/main/java/org/ldk/structs/BaseSign.java | 37 +- src/main/java/org/ldk/structs/BestBlock.java | 7 +- .../structs/BuiltCommitmentTransaction.java | 11 +- .../java/org/ldk/structs/ChainMonitor.java | 1 + .../java/org/ldk/structs/ChainParameters.java | 5 + .../org/ldk/structs/ChannelAnnouncement.java | 15 +- .../java/org/ldk/structs/ChannelConfig.java | 5 + .../org/ldk/structs/ChannelCounterparty.java | 9 +- .../java/org/ldk/structs/ChannelDetails.java | 9 +- .../java/org/ldk/structs/ChannelFeatures.java | 5 + .../ldk/structs/ChannelHandshakeConfig.java | 5 + .../ldk/structs/ChannelHandshakeLimits.java | 5 + .../java/org/ldk/structs/ChannelInfo.java | 5 + .../java/org/ldk/structs/ChannelManager.java | 24 +- .../ldk/structs/ChannelManagerPersister.java | 2 +- .../ldk/structs/ChannelMessageHandler.java | 40 +- .../java/org/ldk/structs/ChannelMonitor.java | 15 +- .../org/ldk/structs/ChannelMonitorUpdate.java | 5 + .../org/ldk/structs/ChannelPublicKeys.java | 17 +- .../org/ldk/structs/ChannelReestablish.java | 7 +- .../structs/ChannelTransactionParameters.java | 5 + .../java/org/ldk/structs/ChannelUpdate.java | 9 +- .../java/org/ldk/structs/ClosingSigned.java | 11 +- .../ldk/structs/ClosingSignedFeeRange.java | 5 + .../org/ldk/structs/ClosingTransaction.java | 5 + .../java/org/ldk/structs/ClosureReason.java | 39 + .../org/ldk/structs/CommitmentSigned.java | 13 +- .../ldk/structs/CommitmentTransaction.java | 5 + .../org/ldk/structs/CommitmentUpdate.java | 5 + src/main/java/org/ldk/structs/Confirm.java | 9 +- ...nterpartyChannelTransactionParameters.java | 5 + .../structs/CounterpartyForwardingInfo.java | 5 + .../org/ldk/structs/CustomMessageHandler.java | 6 +- .../org/ldk/structs/CustomMessageReader.java | 2 +- .../java/org/ldk/structs/DataLossProtect.java | 11 +- .../java/org/ldk/structs/DecodeError.java | 5 + .../DelayedPaymentOutputDescriptor.java | 13 +- .../java/org/ldk/structs/Description.java | 5 + .../ldk/structs/DirectionalChannelInfo.java | 5 + .../java/org/ldk/structs/ErrorAction.java | 18 + .../java/org/ldk/structs/ErrorMessage.java | 9 +- src/main/java/org/ldk/structs/Event.java | 70 +- src/main/java/org/ldk/structs/ExpiryTime.java | 5 + src/main/java/org/ldk/structs/Fallback.java | 9 +- src/main/java/org/ldk/structs/Filter.java | 4 +- .../java/org/ldk/structs/FundingCreated.java | 13 +- .../java/org/ldk/structs/FundingLocked.java | 11 +- .../java/org/ldk/structs/FundingSigned.java | 11 +- .../ldk/structs/GossipTimestampFilter.java | 9 +- .../ldk/structs/HTLCOutputInCommitment.java | 9 +- src/main/java/org/ldk/structs/HTLCUpdate.java | 5 + .../structs/HolderCommitmentTransaction.java | 11 +- .../java/org/ldk/structs/InMemorySigner.java | 19 +- src/main/java/org/ldk/structs/Init.java | 5 + .../java/org/ldk/structs/InitFeatures.java | 5 + .../ldk/structs/InvalidShutdownScript.java | 5 + src/main/java/org/ldk/structs/Invoice.java | 5 + .../java/org/ldk/structs/InvoiceFeatures.java | 5 + .../java/org/ldk/structs/InvoicePayer.java | 2 +- .../org/ldk/structs/InvoiceSignature.java | 5 + .../java/org/ldk/structs/KeysInterface.java | 14 +- .../java/org/ldk/structs/KeysManager.java | 4 +- .../java/org/ldk/structs/LightningError.java | 5 + src/main/java/org/ldk/structs/Listen.java | 2 +- src/main/java/org/ldk/structs/Logger.java | 7 +- .../org/ldk/structs/MessageSendEvent.java | 108 +- .../structs/MessageSendEventsProvider.java | 2 +- .../org/ldk/structs/MinFinalCltvExpiry.java | 5 + .../java/org/ldk/structs/MonitorEvent.java | 23 + .../org/ldk/structs/MonitorUpdateError.java | 5 + .../java/org/ldk/structs/MonitorUpdateId.java | 5 + src/main/java/org/ldk/structs/NetAddress.java | 27 +- .../org/ldk/structs/NetGraphMsgHandler.java | 2 + .../java/org/ldk/structs/NetworkGraph.java | 11 +- .../java/org/ldk/structs/NetworkUpdate.java | 19 +- .../org/ldk/structs/NodeAnnouncement.java | 9 +- .../org/ldk/structs/NodeAnnouncementInfo.java | 11 +- .../java/org/ldk/structs/NodeFeatures.java | 5 + src/main/java/org/ldk/structs/NodeId.java | 7 +- src/main/java/org/ldk/structs/NodeInfo.java | 5 + .../java/org/ldk/structs/OpenChannel.java | 21 +- .../java/org/ldk/structs/Option_AccessZ.java | 6 + .../Option_C2Tuple_usizeTransactionZZ.java | 11 + .../ldk/structs/Option_CVec_NetAddressZZ.java | 11 + .../ldk/structs/Option_ClosureReasonZ.java | 92 + .../java/org/ldk/structs/Option_EventZ.java | 92 + .../java/org/ldk/structs/Option_FilterZ.java | 6 + .../org/ldk/structs/Option_MonitorEventZ.java | 92 + .../ldk/structs/Option_NetworkUpdateZ.java | 11 + .../java/org/ldk/structs/Option_TypeZ.java | 11 + .../java/org/ldk/structs/Option_u16Z.java | 11 + .../java/org/ldk/structs/Option_u32Z.java | 11 + .../java/org/ldk/structs/Option_u64Z.java | 11 + src/main/java/org/ldk/structs/OutPoint.java | 9 +- src/main/java/org/ldk/structs/Payee.java | 13 +- .../java/org/ldk/structs/PayeePubKey.java | 9 +- src/main/java/org/ldk/structs/Payer.java | 13 +- .../java/org/ldk/structs/PaymentError.java | 14 + .../java/org/ldk/structs/PaymentPurpose.java | 16 +- .../org/ldk/structs/PaymentSendFailure.java | 40 +- .../java/org/ldk/structs/PeerHandleError.java | 5 + .../java/org/ldk/structs/PeerManager.java | 6 +- src/main/java/org/ldk/structs/Persist.java | 4 +- src/main/java/org/ldk/structs/Ping.java | 5 + src/main/java/org/ldk/structs/Pong.java | 5 + .../org/ldk/structs/PositiveTimestamp.java | 5 + .../java/org/ldk/structs/PrivateRoute.java | 5 + .../org/ldk/structs/QueryChannelRange.java | 9 +- .../org/ldk/structs/QueryShortChannelIds.java | 9 +- .../java/org/ldk/structs/RawDataPart.java | 5 + src/main/java/org/ldk/structs/RawInvoice.java | 5 + .../org/ldk/structs/ReadOnlyNetworkGraph.java | 2 +- src/main/java/org/ldk/structs/Record.java | 114 + .../org/ldk/structs/ReplyChannelRange.java | 9 +- .../ldk/structs/ReplyShortChannelIdsEnd.java | 9 +- .../Result_AcceptChannelDecodeErrorZ.java | 15 +- ...lt_AnnouncementSignaturesDecodeErrorZ.java | 15 +- ...uiltCommitmentTransactionDecodeErrorZ.java | 15 +- ..._BlockHashChannelManagerZDecodeErrorZ.java | 10 +- ..._BlockHashChannelMonitorZDecodeErrorZ.java | 15 +- ...mentHashPaymentIdZPaymentSendFailureZ.java | 15 +- ...2Tuple_SignatureCVec_SignatureZZNoneZ.java | 15 +- ...lt_COption_ClosureReasonZDecodeErrorZ.java | 88 + .../Result_COption_EventZDecodeErrorZ.java | 88 + ...ult_COption_MonitorEventZDecodeErrorZ.java | 88 + ...lt_COption_NetworkUpdateZDecodeErrorZ.java | 88 + .../Result_COption_TypeZDecodeErrorZ.java | 15 +- ...Tuple_BlockHashChannelMonitorZZErrorZ.java | 15 +- .../structs/Result_CVec_CVec_u8ZZNoneZ.java | 15 +- .../structs/Result_CVec_SignatureZNoneZ.java | 17 +- .../Result_CVec_u8ZPeerHandleErrorZ.java | 15 +- ...esult_ChannelAnnouncementDecodeErrorZ.java | 15 +- .../Result_ChannelConfigDecodeErrorZ.java | 15 +- .../Result_ChannelFeaturesDecodeErrorZ.java | 10 +- .../Result_ChannelInfoDecodeErrorZ.java | 15 +- ...sult_ChannelMonitorUpdateDecodeErrorZ.java | 15 +- .../Result_ChannelPublicKeysDecodeErrorZ.java | 15 +- ...Result_ChannelReestablishDecodeErrorZ.java | 15 +- ...nnelTransactionParametersDecodeErrorZ.java | 15 +- .../Result_ChannelUpdateDecodeErrorZ.java | 15 +- .../Result_ClosingSignedDecodeErrorZ.java | 15 +- ...ult_ClosingSignedFeeRangeDecodeErrorZ.java | 15 +- .../Result_CommitmentSignedDecodeErrorZ.java | 15 +- ...ult_CommitmentTransactionDecodeErrorZ.java | 15 +- ...nnelTransactionParametersDecodeErrorZ.java | 15 +- ...edPaymentOutputDescriptorDecodeErrorZ.java | 15 +- .../Result_DescriptionCreationErrorZ.java | 15 +- ...lt_DirectionalChannelInfoDecodeErrorZ.java | 15 +- .../Result_ErrorMessageDecodeErrorZ.java | 15 +- .../Result_ExpiryTimeCreationErrorZ.java | 15 +- .../Result_FundingCreatedDecodeErrorZ.java | 15 +- .../Result_FundingLockedDecodeErrorZ.java | 15 +- .../Result_FundingSignedDecodeErrorZ.java | 15 +- ...ult_GossipTimestampFilterDecodeErrorZ.java | 15 +- ...lt_HTLCOutputInCommitmentDecodeErrorZ.java | 15 +- .../Result_HTLCUpdateDecodeErrorZ.java | 15 +- ...lderCommitmentTransactionDecodeErrorZ.java | 15 +- .../Result_InMemorySignerDecodeErrorZ.java | 15 +- .../ldk/structs/Result_InitDecodeErrorZ.java | 15 +- .../Result_InitFeaturesDecodeErrorZ.java | 10 +- .../Result_InvoiceFeaturesDecodeErrorZ.java | 10 +- .../org/ldk/structs/Result_InvoiceNoneZ.java | 15 +- .../structs/Result_InvoiceSemanticErrorZ.java | 15 +- .../Result_InvoiceSignOrCreationErrorZ.java | 15 +- .../Result_LockedChannelMonitorNoneZ.java | 10 +- .../Result_NetAddressDecodeErrorZ.java | 15 +- .../Result_NetworkGraphDecodeErrorZ.java | 15 +- .../Result_NodeAnnouncementDecodeErrorZ.java | 15 +- ...sult_NodeAnnouncementInfoDecodeErrorZ.java | 15 +- .../Result_NodeFeaturesDecodeErrorZ.java | 10 +- .../structs/Result_NodeIdDecodeErrorZ.java | 15 +- .../structs/Result_NodeInfoDecodeErrorZ.java | 15 +- .../org/ldk/structs/Result_NoneAPIErrorZ.java | 15 +- .../Result_NoneChannelMonitorUpdateErrZ.java | 15 +- .../org/ldk/structs/Result_NoneErrorZ.java | 15 +- .../structs/Result_NoneLightningErrorZ.java | 15 +- .../Result_NoneMonitorUpdateErrorZ.java | 15 +- .../org/ldk/structs/Result_NoneNoneZ.java | 15 +- .../Result_NonePaymentSendFailureZ.java | 15 +- .../structs/Result_NonePeerHandleErrorZ.java | 15 +- .../structs/Result_NoneSemanticErrorZ.java | 15 +- .../Result_OpenChannelDecodeErrorZ.java | 15 +- .../structs/Result_OutPointDecodeErrorZ.java | 15 +- .../ldk/structs/Result_PayeeDecodeErrorZ.java | 15 +- .../ldk/structs/Result_PayeePubKeyErrorZ.java | 15 +- .../Result_PaymentIdPaymentErrorZ.java | 17 +- .../Result_PaymentIdPaymentSendFailureZ.java | 17 +- .../Result_PaymentSecretAPIErrorZ.java | 17 +- .../ldk/structs/Result_PingDecodeErrorZ.java | 15 +- .../ldk/structs/Result_PongDecodeErrorZ.java | 15 +- ...esult_PositiveTimestampCreationErrorZ.java | 15 +- .../Result_PrivateRouteCreationErrorZ.java | 15 +- .../ldk/structs/Result_PublicKeyErrorZ.java | 17 +- .../Result_QueryChannelRangeDecodeErrorZ.java | 15 +- ...sult_QueryShortChannelIdsDecodeErrorZ.java | 15 +- .../Result_RecoverableSignatureNoneZ.java | 17 +- .../Result_ReplyChannelRangeDecodeErrorZ.java | 15 +- ...t_ReplyShortChannelIdsEndDecodeErrorZ.java | 15 +- .../Result_RevokeAndACKDecodeErrorZ.java | 15 +- .../ldk/structs/Result_RouteDecodeErrorZ.java | 15 +- .../structs/Result_RouteHintDecodeErrorZ.java | 15 +- .../Result_RouteHintHopDecodeErrorZ.java | 15 +- .../structs/Result_RouteHopDecodeErrorZ.java | 15 +- .../structs/Result_RouteLightningErrorZ.java | 15 +- .../Result_RouteParametersDecodeErrorZ.java | 15 +- .../Result_RoutingFeesDecodeErrorZ.java | 15 +- .../structs/Result_ScorerDecodeErrorZ.java | 81 + .../Result_ScoringParametersDecodeErrorZ.java | 72 + .../ldk/structs/Result_SecretKeyErrorZ.java | 12 +- .../structs/Result_ShutdownDecodeErrorZ.java | 15 +- .../Result_ShutdownScriptDecodeErrorZ.java | 15 +- ..._ShutdownScriptInvalidShutdownScriptZ.java | 15 +- .../org/ldk/structs/Result_SiPrefixNoneZ.java | 15 +- .../ldk/structs/Result_SignDecodeErrorZ.java | 15 +- .../ldk/structs/Result_SignatureNoneZ.java | 17 +- .../structs/Result_SignedRawInvoiceNoneZ.java | 15 +- ...SpendableOutputDescriptorDecodeErrorZ.java | 15 +- ...icPaymentOutputDescriptorDecodeErrorZ.java | 15 +- .../org/ldk/structs/Result_StringErrorZ.java | 10 +- .../ldk/structs/Result_TransactionNoneZ.java | 15 +- ...Result_TrustedClosingTransactionNoneZ.java | 10 +- ...ult_TrustedCommitmentTransactionNoneZ.java | 10 +- .../Result_TxCreationKeysDecodeErrorZ.java | 15 +- .../structs/Result_TxCreationKeysErrorZ.java | 15 +- .../ldk/structs/Result_TxOutAccessErrorZ.java | 15 +- ...signedChannelAnnouncementDecodeErrorZ.java | 15 +- ...ult_UnsignedChannelUpdateDecodeErrorZ.java | 15 +- ..._UnsignedNodeAnnouncementDecodeErrorZ.java | 15 +- .../Result_UpdateAddHTLCDecodeErrorZ.java | 15 +- .../Result_UpdateFailHTLCDecodeErrorZ.java | 15 +- ...t_UpdateFailMalformedHTLCDecodeErrorZ.java | 15 +- .../structs/Result_UpdateFeeDecodeErrorZ.java | 15 +- .../Result_UpdateFulfillHTLCDecodeErrorZ.java | 15 +- .../ldk/structs/Result__u832APIErrorZ.java | 17 +- .../structs/Result_boolLightningErrorZ.java | 15 +- .../structs/Result_boolPeerHandleErrorZ.java | 15 +- .../java/org/ldk/structs/RetryAttempts.java | 5 + .../java/org/ldk/structs/RevokeAndACK.java | 13 +- src/main/java/org/ldk/structs/Route.java | 5 + src/main/java/org/ldk/structs/RouteHint.java | 5 + .../java/org/ldk/structs/RouteHintHop.java | 9 +- src/main/java/org/ldk/structs/RouteHop.java | 9 +- .../java/org/ldk/structs/RouteParameters.java | 5 + src/main/java/org/ldk/structs/Router.java | 4 +- .../java/org/ldk/structs/RoutingFees.java | 5 + .../ldk/structs/RoutingMessageHandler.java | 30 +- src/main/java/org/ldk/structs/Sha256.java | 5 + src/main/java/org/ldk/structs/Shutdown.java | 9 +- .../java/org/ldk/structs/ShutdownScript.java | 9 +- src/main/java/org/ldk/structs/Sign.java | 7 +- .../org/ldk/structs/SignOrCreationError.java | 11 + .../org/ldk/structs/SignedRawInvoice.java | 5 + .../org/ldk/structs/SocketDescriptor.java | 5 + .../structs/SpendableOutputDescriptor.java | 51 + .../StaticPaymentOutputDescriptor.java | 9 +- ...nouncementChannelUpdateChannelUpdateZ.java | 61 + ...uple_RawInvoice_u832InvoiceSignatureZ.java | 58 + .../structs/TrustedClosingTransaction.java | 2 +- .../structs/TrustedCommitmentTransaction.java | 2 +- .../TwoTuple_BlockHashChannelManagerZ.java | 2 +- .../TwoTuple_BlockHashChannelMonitorZ.java | 7 +- .../ldk/structs/TwoTuple_OutPointScriptZ.java | 5 + .../TwoTuple_PaymentHashPaymentIdZ.java | 7 +- .../TwoTuple_PaymentHashPaymentSecretZ.java | 7 +- .../ldk/structs/TwoTuple_PublicKeyTypeZ.java | 7 +- .../TwoTuple_SignatureCVec_SignatureZZ.java | 7 +- ...woTuple_TxidCVec_C2Tuple_u32ScriptZZZ.java | 7 +- ...TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.java | 7 +- .../org/ldk/structs/TwoTuple_u32ScriptZ.java | 5 + .../org/ldk/structs/TwoTuple_u32TxOutZ.java | 5 + .../structs/TwoTuple_usizeTransactionZ.java | 5 + .../java/org/ldk/structs/TxCreationKeys.java | 21 +- src/main/java/org/ldk/structs/Type.java | 5 + .../structs/UnsignedChannelAnnouncement.java | 15 +- .../ldk/structs/UnsignedChannelUpdate.java | 7 +- .../ldk/structs/UnsignedNodeAnnouncement.java | 11 +- .../java/org/ldk/structs/UpdateAddHTLC.java | 9 +- .../java/org/ldk/structs/UpdateFailHTLC.java | 7 +- .../ldk/structs/UpdateFailMalformedHTLC.java | 7 +- src/main/java/org/ldk/structs/UpdateFee.java | 9 +- .../org/ldk/structs/UpdateFulfillHTLC.java | 11 +- src/main/java/org/ldk/structs/UserConfig.java | 5 + .../java/org/ldk/structs/UtilMethods.java | 67 +- src/main/java/org/ldk/structs/Watch.java | 6 +- .../java/org/ldk/structs/WatchedOutput.java | 9 +- src/main/jni/bindings.c | 8765 ++++++++++++++--- src/main/jni/bindings.c.body | 8765 ++++++++++++++--- src/main/jni/org_ldk_impl_bindings.h | 4746 ++++++--- ts/bindings.c | 8438 +++++++++++++--- ts/bindings.c.body | 8438 +++++++++++++--- ts/bindings.ts | 3829 ++++++- ts/enums/AccessError.ts | 10 +- ts/enums/ChannelMonitorUpdateErr.ts | 66 +- ts/enums/ConfirmationTarget.ts | 15 +- ts/enums/CreationError.ts | 20 +- ts/enums/Currency.ts | 25 +- ts/enums/Level.ts | 25 +- ts/enums/Network.ts | 20 +- ts/enums/Secp256k1Error.ts | 45 +- ts/enums/SemanticError.ts | 51 +- ts/enums/SiPrefix.ts | 20 +- ts/structs/APIError.ts | 5 + ts/structs/AcceptChannel.ts | 19 +- ts/structs/Access.ts | 4 +- ts/structs/AnnouncementSignatures.ts | 13 +- ts/structs/Balance.ts | 5 + ts/structs/BaseSign.ts | 37 +- ts/structs/BestBlock.ts | 7 +- ts/structs/BuiltCommitmentTransaction.ts | 11 +- ts/structs/ChainMonitor.ts | 1 + ts/structs/ChainParameters.ts | 5 + ts/structs/ChannelAnnouncement.ts | 15 +- ts/structs/ChannelConfig.ts | 5 + ts/structs/ChannelCounterparty.ts | 9 +- ts/structs/ChannelDetails.ts | 9 +- ts/structs/ChannelFeatures.ts | 5 + ts/structs/ChannelHandshakeConfig.ts | 5 + ts/structs/ChannelHandshakeLimits.ts | 5 + ts/structs/ChannelInfo.ts | 5 + ts/structs/ChannelManager.ts | 24 +- ts/structs/ChannelManagerPersister.ts | 2 +- ts/structs/ChannelMessageHandler.ts | 40 +- ts/structs/ChannelMonitor.ts | 15 +- ts/structs/ChannelMonitorUpdate.ts | 5 + ts/structs/ChannelPublicKeys.ts | 17 +- ts/structs/ChannelReestablish.ts | 7 +- ts/structs/ChannelTransactionParameters.ts | 5 + ts/structs/ChannelUpdate.ts | 9 +- ts/structs/ClosingSigned.ts | 11 +- ts/structs/ClosingSignedFeeRange.ts | 5 + ts/structs/ClosingTransaction.ts | 5 + ts/structs/ClosureReason.ts | 5 + ts/structs/CommitmentSigned.ts | 13 +- ts/structs/CommitmentTransaction.ts | 5 + ts/structs/CommitmentUpdate.ts | 5 + ts/structs/Confirm.ts | 9 +- ...ounterpartyChannelTransactionParameters.ts | 5 + ts/structs/CounterpartyForwardingInfo.ts | 5 + ts/structs/CustomMessageHandler.ts | 6 +- ts/structs/CustomMessageReader.ts | 2 +- ts/structs/DataLossProtect.ts | 11 +- ts/structs/DecodeError.ts | 5 + ts/structs/DelayedPaymentOutputDescriptor.ts | 13 +- ts/structs/Description.ts | 5 + ts/structs/DirectionalChannelInfo.ts | 5 + ts/structs/ErrorAction.ts | 5 + ts/structs/ErrorMessage.ts | 9 +- ts/structs/Event.ts | 17 +- ts/structs/ExpiryTime.ts | 5 + ts/structs/Fallback.ts | 9 +- ts/structs/Filter.ts | 4 +- ts/structs/FundingCreated.ts | 13 +- ts/structs/FundingLocked.ts | 11 +- ts/structs/FundingSigned.ts | 11 +- ts/structs/GossipTimestampFilter.ts | 9 +- ts/structs/HTLCOutputInCommitment.ts | 9 +- ts/structs/HTLCUpdate.ts | 5 + ts/structs/HolderCommitmentTransaction.ts | 11 +- ts/structs/InMemorySigner.ts | 19 +- ts/structs/Init.ts | 5 + ts/structs/InitFeatures.ts | 5 + ts/structs/InvalidShutdownScript.ts | 5 + ts/structs/Invoice.ts | 5 + ts/structs/InvoiceFeatures.ts | 5 + ts/structs/InvoicePayer.ts | 2 +- ts/structs/InvoiceSignature.ts | 5 + ts/structs/KeysInterface.ts | 14 +- ts/structs/KeysManager.ts | 4 +- ts/structs/LightningError.ts | 5 + ts/structs/Listen.ts | 2 +- ts/structs/Logger.ts | 7 +- ts/structs/MessageSendEvent.ts | 37 +- ts/structs/MessageSendEventsProvider.ts | 2 +- ts/structs/MinFinalCltvExpiry.ts | 5 + ts/structs/MonitorEvent.ts | 5 + ts/structs/MonitorUpdateError.ts | 5 + ts/structs/MonitorUpdateId.ts | 5 + ts/structs/NetAddress.ts | 13 +- ts/structs/NetGraphMsgHandler.ts | 2 + ts/structs/NetworkGraph.ts | 11 +- ts/structs/NetworkUpdate.ts | 7 +- ts/structs/NodeAnnouncement.ts | 9 +- ts/structs/NodeAnnouncementInfo.ts | 11 +- ts/structs/NodeFeatures.ts | 5 + ts/structs/NodeId.ts | 7 +- ts/structs/NodeInfo.ts | 5 + ts/structs/OpenChannel.ts | 21 +- .../Option_C2Tuple_usizeTransactionZZ.ts | 5 + ts/structs/Option_CVec_NetAddressZZ.ts | 5 + ts/structs/Option_ClosureReasonZ.ts | 64 + ts/structs/Option_EventZ.ts | 64 + ts/structs/Option_MonitorEventZ.ts | 64 + ts/structs/Option_NetworkUpdateZ.ts | 5 + ts/structs/Option_TypeZ.ts | 5 + ts/structs/Option_u16Z.ts | 5 + ts/structs/Option_u32Z.ts | 5 + ts/structs/Option_u64Z.ts | 5 + ts/structs/OutPoint.ts | 9 +- ts/structs/Payee.ts | 13 +- ts/structs/PayeePubKey.ts | 9 +- ts/structs/Payer.ts | 13 +- ts/structs/PaymentError.ts | 5 + ts/structs/PaymentPurpose.ts | 9 +- ts/structs/PaymentSendFailure.ts | 7 +- ts/structs/PeerHandleError.ts | 5 + ts/structs/PeerManager.ts | 6 +- ts/structs/Persist.ts | 4 +- ts/structs/Ping.ts | 5 + ts/structs/Pong.ts | 5 + ts/structs/PositiveTimestamp.ts | 5 + ts/structs/PrivateRoute.ts | 5 + ts/structs/QueryChannelRange.ts | 9 +- ts/structs/QueryShortChannelIds.ts | 9 +- ts/structs/RawDataPart.ts | 5 + ts/structs/RawInvoice.ts | 5 + ts/structs/ReadOnlyNetworkGraph.ts | 2 +- ts/structs/Record.ts | 78 + ts/structs/ReplyChannelRange.ts | 9 +- ts/structs/ReplyShortChannelIdsEnd.ts | 9 +- .../Result_AcceptChannelDecodeErrorZ.ts | 12 +- ...sult_AnnouncementSignaturesDecodeErrorZ.ts | 12 +- ..._BuiltCommitmentTransactionDecodeErrorZ.ts | 12 +- ...le_BlockHashChannelManagerZDecodeErrorZ.ts | 7 +- ...le_BlockHashChannelMonitorZDecodeErrorZ.ts | 12 +- ...aymentHashPaymentIdZPaymentSendFailureZ.ts | 12 +- ..._C2Tuple_SignatureCVec_SignatureZZNoneZ.ts | 12 +- ...sult_COption_ClosureReasonZDecodeErrorZ.ts | 68 + .../Result_COption_EventZDecodeErrorZ.ts | 68 + ...esult_COption_MonitorEventZDecodeErrorZ.ts | 68 + ...sult_COption_NetworkUpdateZDecodeErrorZ.ts | 68 + .../Result_COption_TypeZDecodeErrorZ.ts | 12 +- ...C2Tuple_BlockHashChannelMonitorZZErrorZ.ts | 12 +- ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts | 12 +- ts/structs/Result_CVec_SignatureZNoneZ.ts | 14 +- ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts | 12 +- .../Result_ChannelAnnouncementDecodeErrorZ.ts | 12 +- .../Result_ChannelConfigDecodeErrorZ.ts | 12 +- .../Result_ChannelFeaturesDecodeErrorZ.ts | 7 +- ts/structs/Result_ChannelInfoDecodeErrorZ.ts | 12 +- ...Result_ChannelMonitorUpdateDecodeErrorZ.ts | 12 +- .../Result_ChannelPublicKeysDecodeErrorZ.ts | 12 +- .../Result_ChannelReestablishDecodeErrorZ.ts | 12 +- ...hannelTransactionParametersDecodeErrorZ.ts | 12 +- .../Result_ChannelUpdateDecodeErrorZ.ts | 12 +- .../Result_ClosingSignedDecodeErrorZ.ts | 12 +- ...esult_ClosingSignedFeeRangeDecodeErrorZ.ts | 12 +- .../Result_CommitmentSignedDecodeErrorZ.ts | 12 +- ...esult_CommitmentTransactionDecodeErrorZ.ts | 12 +- ...hannelTransactionParametersDecodeErrorZ.ts | 12 +- ...ayedPaymentOutputDescriptorDecodeErrorZ.ts | 12 +- .../Result_DescriptionCreationErrorZ.ts | 12 +- ...sult_DirectionalChannelInfoDecodeErrorZ.ts | 12 +- ts/structs/Result_ErrorMessageDecodeErrorZ.ts | 12 +- ts/structs/Result_ExpiryTimeCreationErrorZ.ts | 12 +- .../Result_FundingCreatedDecodeErrorZ.ts | 12 +- .../Result_FundingLockedDecodeErrorZ.ts | 12 +- .../Result_FundingSignedDecodeErrorZ.ts | 12 +- ...esult_GossipTimestampFilterDecodeErrorZ.ts | 12 +- ...sult_HTLCOutputInCommitmentDecodeErrorZ.ts | 12 +- ts/structs/Result_HTLCUpdateDecodeErrorZ.ts | 12 +- ...HolderCommitmentTransactionDecodeErrorZ.ts | 12 +- .../Result_InMemorySignerDecodeErrorZ.ts | 12 +- ts/structs/Result_InitDecodeErrorZ.ts | 12 +- ts/structs/Result_InitFeaturesDecodeErrorZ.ts | 7 +- .../Result_InvoiceFeaturesDecodeErrorZ.ts | 7 +- ts/structs/Result_InvoiceNoneZ.ts | 12 +- ts/structs/Result_InvoiceSemanticErrorZ.ts | 12 +- .../Result_InvoiceSignOrCreationErrorZ.ts | 12 +- .../Result_LockedChannelMonitorNoneZ.ts | 7 +- ts/structs/Result_NetAddressDecodeErrorZ.ts | 12 +- ts/structs/Result_NetworkGraphDecodeErrorZ.ts | 12 +- .../Result_NodeAnnouncementDecodeErrorZ.ts | 12 +- ...Result_NodeAnnouncementInfoDecodeErrorZ.ts | 12 +- ts/structs/Result_NodeFeaturesDecodeErrorZ.ts | 7 +- ts/structs/Result_NodeIdDecodeErrorZ.ts | 12 +- ts/structs/Result_NodeInfoDecodeErrorZ.ts | 12 +- ts/structs/Result_NoneAPIErrorZ.ts | 12 +- .../Result_NoneChannelMonitorUpdateErrZ.ts | 12 +- ts/structs/Result_NoneErrorZ.ts | 12 +- ts/structs/Result_NoneLightningErrorZ.ts | 12 +- ts/structs/Result_NoneMonitorUpdateErrorZ.ts | 12 +- ts/structs/Result_NoneNoneZ.ts | 12 +- ts/structs/Result_NonePaymentSendFailureZ.ts | 12 +- ts/structs/Result_NonePeerHandleErrorZ.ts | 12 +- ts/structs/Result_NoneSemanticErrorZ.ts | 12 +- ts/structs/Result_OpenChannelDecodeErrorZ.ts | 12 +- ts/structs/Result_OutPointDecodeErrorZ.ts | 12 +- ts/structs/Result_PayeeDecodeErrorZ.ts | 12 +- ts/structs/Result_PayeePubKeyErrorZ.ts | 12 +- ts/structs/Result_PaymentIdPaymentErrorZ.ts | 14 +- .../Result_PaymentIdPaymentSendFailureZ.ts | 14 +- ts/structs/Result_PaymentSecretAPIErrorZ.ts | 14 +- ts/structs/Result_PingDecodeErrorZ.ts | 12 +- ts/structs/Result_PongDecodeErrorZ.ts | 12 +- .../Result_PositiveTimestampCreationErrorZ.ts | 12 +- .../Result_PrivateRouteCreationErrorZ.ts | 12 +- ts/structs/Result_PublicKeyErrorZ.ts | 14 +- .../Result_QueryChannelRangeDecodeErrorZ.ts | 12 +- ...Result_QueryShortChannelIdsDecodeErrorZ.ts | 12 +- .../Result_RecoverableSignatureNoneZ.ts | 14 +- .../Result_ReplyChannelRangeDecodeErrorZ.ts | 12 +- ...ult_ReplyShortChannelIdsEndDecodeErrorZ.ts | 12 +- ts/structs/Result_RevokeAndACKDecodeErrorZ.ts | 12 +- ts/structs/Result_RouteDecodeErrorZ.ts | 12 +- ts/structs/Result_RouteHintDecodeErrorZ.ts | 12 +- ts/structs/Result_RouteHintHopDecodeErrorZ.ts | 12 +- ts/structs/Result_RouteHopDecodeErrorZ.ts | 12 +- ts/structs/Result_RouteLightningErrorZ.ts | 12 +- .../Result_RouteParametersDecodeErrorZ.ts | 12 +- ts/structs/Result_RoutingFeesDecodeErrorZ.ts | 12 +- ts/structs/Result_ScorerDecodeErrorZ.ts | 66 + .../Result_ScoringParametersDecodeErrorZ.ts | 57 + ts/structs/Result_SecretKeyErrorZ.ts | 9 +- ts/structs/Result_ShutdownDecodeErrorZ.ts | 12 +- .../Result_ShutdownScriptDecodeErrorZ.ts | 12 +- ...lt_ShutdownScriptInvalidShutdownScriptZ.ts | 12 +- ts/structs/Result_SiPrefixNoneZ.ts | 12 +- ts/structs/Result_SignDecodeErrorZ.ts | 12 +- ts/structs/Result_SignatureNoneZ.ts | 14 +- ts/structs/Result_SignedRawInvoiceNoneZ.ts | 12 +- ...t_SpendableOutputDescriptorDecodeErrorZ.ts | 12 +- ...aticPaymentOutputDescriptorDecodeErrorZ.ts | 12 +- ts/structs/Result_StringErrorZ.ts | 7 +- ts/structs/Result_TransactionNoneZ.ts | 12 +- .../Result_TrustedClosingTransactionNoneZ.ts | 7 +- ...esult_TrustedCommitmentTransactionNoneZ.ts | 7 +- .../Result_TxCreationKeysDecodeErrorZ.ts | 12 +- ts/structs/Result_TxCreationKeysErrorZ.ts | 12 +- ts/structs/Result_TxOutAccessErrorZ.ts | 12 +- ...UnsignedChannelAnnouncementDecodeErrorZ.ts | 12 +- ...esult_UnsignedChannelUpdateDecodeErrorZ.ts | 12 +- ...lt_UnsignedNodeAnnouncementDecodeErrorZ.ts | 12 +- .../Result_UpdateAddHTLCDecodeErrorZ.ts | 12 +- .../Result_UpdateFailHTLCDecodeErrorZ.ts | 12 +- ...ult_UpdateFailMalformedHTLCDecodeErrorZ.ts | 12 +- ts/structs/Result_UpdateFeeDecodeErrorZ.ts | 12 +- .../Result_UpdateFulfillHTLCDecodeErrorZ.ts | 12 +- ts/structs/Result__u832APIErrorZ.ts | 14 +- ts/structs/Result_boolLightningErrorZ.ts | 12 +- ts/structs/Result_boolPeerHandleErrorZ.ts | 12 +- ts/structs/RetryAttempts.ts | 5 + ts/structs/RevokeAndACK.ts | 13 +- ts/structs/Route.ts | 5 + ts/structs/RouteHint.ts | 5 + ts/structs/RouteHintHop.ts | 9 +- ts/structs/RouteHop.ts | 9 +- ts/structs/RouteParameters.ts | 5 + ts/structs/Router.ts | 4 +- ts/structs/RoutingFees.ts | 5 + ts/structs/RoutingMessageHandler.ts | 30 +- ts/structs/Sha256.ts | 5 + ts/structs/Shutdown.ts | 9 +- ts/structs/ShutdownScript.ts | 9 +- ts/structs/Sign.ts | 7 +- ts/structs/SignOrCreationError.ts | 5 + ts/structs/SignedRawInvoice.ts | 5 + ts/structs/SocketDescriptor.ts | 5 + ts/structs/SpendableOutputDescriptor.ts | 5 + ts/structs/StaticPaymentOutputDescriptor.ts | 9 +- ...AnnouncementChannelUpdateChannelUpdateZ.ts | 40 + ...eTuple_RawInvoice_u832InvoiceSignatureZ.ts | 38 + ts/structs/TrustedClosingTransaction.ts | 2 +- ts/structs/TrustedCommitmentTransaction.ts | 2 +- .../TwoTuple_BlockHashChannelManagerZ.ts | 2 +- .../TwoTuple_BlockHashChannelMonitorZ.ts | 7 +- ts/structs/TwoTuple_OutPointScriptZ.ts | 5 + ts/structs/TwoTuple_PaymentHashPaymentIdZ.ts | 7 +- .../TwoTuple_PaymentHashPaymentSecretZ.ts | 7 +- ts/structs/TwoTuple_PublicKeyTypeZ.ts | 7 +- .../TwoTuple_SignatureCVec_SignatureZZ.ts | 7 +- .../TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.ts | 7 +- .../TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.ts | 7 +- ts/structs/TwoTuple_u32ScriptZ.ts | 5 + ts/structs/TwoTuple_u32TxOutZ.ts | 5 + ts/structs/TwoTuple_usizeTransactionZ.ts | 5 + ts/structs/TxCreationKeys.ts | 21 +- ts/structs/Type.ts | 5 + ts/structs/UnsignedChannelAnnouncement.ts | 15 +- ts/structs/UnsignedChannelUpdate.ts | 7 +- ts/structs/UnsignedNodeAnnouncement.ts | 11 +- ts/structs/UpdateAddHTLC.ts | 9 +- ts/structs/UpdateFailHTLC.ts | 7 +- ts/structs/UpdateFailMalformedHTLC.ts | 7 +- ts/structs/UpdateFee.ts | 9 +- ts/structs/UpdateFulfillHTLC.ts | 11 +- ts/structs/UserConfig.ts | 5 + ts/structs/UtilMethods.ts | 48 +- ts/structs/Watch.ts | 6 +- ts/structs/WatchedOutput.ts | 9 +- 605 files changed, 45060 insertions(+), 7562 deletions(-) create mode 100644 src/main/java/org/ldk/structs/Option_ClosureReasonZ.java create mode 100644 src/main/java/org/ldk/structs/Option_EventZ.java create mode 100644 src/main/java/org/ldk/structs/Option_MonitorEventZ.java create mode 100644 src/main/java/org/ldk/structs/Record.java create mode 100644 src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_ScorerDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_ScoringParametersDecodeErrorZ.java create mode 100644 ts/structs/Option_ClosureReasonZ.ts create mode 100644 ts/structs/Option_EventZ.ts create mode 100644 ts/structs/Option_MonitorEventZ.ts create mode 100644 ts/structs/Record.ts create mode 100644 ts/structs/Result_COption_ClosureReasonZDecodeErrorZ.ts create mode 100644 ts/structs/Result_COption_EventZDecodeErrorZ.ts create mode 100644 ts/structs/Result_COption_MonitorEventZDecodeErrorZ.ts create mode 100644 ts/structs/Result_COption_NetworkUpdateZDecodeErrorZ.ts create mode 100644 ts/structs/Result_ScorerDecodeErrorZ.ts create mode 100644 ts/structs/Result_ScoringParametersDecodeErrorZ.ts diff --git a/src/main/java/org/ldk/enums/AccessError.java b/src/main/java/org/ldk/enums/AccessError.java index 563ff9d7..805a9a5c 100644 --- a/src/main/java/org/ldk/enums/AccessError.java +++ b/src/main/java/org/ldk/enums/AccessError.java @@ -4,7 +4,13 @@ package org.ldk.enums; * An error when accessing the chain via [`Access`]. */ public enum AccessError { + /** + * The requested chain is unknown. + */ LDKAccessError_UnknownChain, + /** + * The requested transaction doesn't exist or hasn't confirmed. + */ LDKAccessError_UnknownTx, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/ChannelMonitorUpdateErr.java b/src/main/java/org/ldk/enums/ChannelMonitorUpdateErr.java index d7b1ddb4..55c551e4 100644 --- a/src/main/java/org/ldk/enums/ChannelMonitorUpdateErr.java +++ b/src/main/java/org/ldk/enums/ChannelMonitorUpdateErr.java @@ -4,7 +4,69 @@ package org.ldk.enums; * An error enum representing a failure to persist a channel monitor update. */ public enum ChannelMonitorUpdateErr { + /** + * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of + * our state failed, but is expected to succeed at some point in the future). + * + * Such a failure will \"freeze\" a channel, preventing us from revoking old states or + * submitting new commitment transactions to the counterparty. Once the update(s) that failed + * have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned + * via [`Watch::release_pending_monitor_events`] which will then restore the channel to an + * operational state. + * + * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If + * you return a TemporaryFailure you must ensure that it is written to disk safely before + * writing out the latest ChannelManager state. + * + * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur + * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting + * to claim it on this channel) and those updates must be applied wherever they can be. At + * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should + * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to + * the channel which would invalidate previous ChannelMonitors are not made when a channel has + * been \"frozen\". + * + * Note that even if updates made after TemporaryFailure succeed you must still provide a + * [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable + * normal channel operation. Note that this is normally generated through a call to + * [`ChainMonitor::channel_monitor_updated`]. + * + * Note that the update being processed here will not be replayed for you when you return a + * [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so + * you must store the update itself on your own local disk prior to returning a + * TemporaryFailure. You may, of course, employ a journaling approach, storing only the + * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at + * reload-time. + * + * For deployments where a copy of ChannelMonitors and other local state are backed up in a + * remote location (with local copies persisted immediately), it is anticipated that all + * updates will return TemporaryFailure until the remote copies could be updated. + * + * [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated + */ LDKChannelMonitorUpdateErr_TemporaryFailure, + /** + * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a + * different watchtower and cannot update with all watchtowers that were previously informed + * of this channel). + * + * At reception of this error, ChannelManager will force-close the channel and return at + * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at + * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel + * update must be rejected. + * + * This failure may also signal a failure to update the local persisted copy of one of + * the channel monitor instance. + * + * Note that even when you fail a holder commitment transaction update, you must store the + * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor + * broadcasts it (e.g distributed channel-monitor deployment) + * + * In case of distributed watchtowers deployment, the new version must be written to disk, as + * state may have been stored but rejected due to a block forcing a commitment broadcast. This + * storage is used to claim outputs of rejected state confirmed onchain by another watchtower, + * lagging behind on block processing. + */ LDKChannelMonitorUpdateErr_PermanentFailure, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/ConfirmationTarget.java b/src/main/java/org/ldk/enums/ConfirmationTarget.java index 3c7cdc4e..bdd116a0 100644 --- a/src/main/java/org/ldk/enums/ConfirmationTarget.java +++ b/src/main/java/org/ldk/enums/ConfirmationTarget.java @@ -5,8 +5,17 @@ package org.ldk.enums; * estimation. */ public enum ConfirmationTarget { + /** + * We are happy with this transaction confirming slowly when feerate drops some. + */ LDKConfirmationTarget_Background, + /** + * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine. + */ LDKConfirmationTarget_Normal, + /** + * We'd like this transaction to confirm in the next few blocks. + */ LDKConfirmationTarget_HighPriority, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/CreationError.java b/src/main/java/org/ldk/enums/CreationError.java index c0f494a2..f46601b3 100644 --- a/src/main/java/org/ldk/enums/CreationError.java +++ b/src/main/java/org/ldk/enums/CreationError.java @@ -4,9 +4,21 @@ package org.ldk.enums; * Errors that may occur when constructing a new `RawInvoice` or `Invoice` */ public enum CreationError { + /** + * The supplied description string was longer than 639 __bytes__ (see [`Description::new(...)`](./struct.Description.html#method.new)) + */ LDKCreationError_DescriptionTooLong, + /** + * The specified route has too many hops and can't be encoded + */ LDKCreationError_RouteTooLong, + /** + * The unix timestamp of the supplied date is <0 or can't be represented as `SystemTime` + */ LDKCreationError_TimestampOutOfBounds, + /** + * The supplied expiry time could cause an overflow if added to a `PositiveTimestamp` + */ LDKCreationError_ExpiryTimeOutOfBounds, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/Currency.java b/src/main/java/org/ldk/enums/Currency.java index a7f11833..67ed429b 100644 --- a/src/main/java/org/ldk/enums/Currency.java +++ b/src/main/java/org/ldk/enums/Currency.java @@ -4,10 +4,25 @@ package org.ldk.enums; * Enum representing the crypto currencies (or networks) supported by this library */ public enum Currency { + /** + * Bitcoin mainnet + */ LDKCurrency_Bitcoin, + /** + * Bitcoin testnet + */ LDKCurrency_BitcoinTestnet, + /** + * Bitcoin regtest + */ LDKCurrency_Regtest, + /** + * Bitcoin simnet + */ LDKCurrency_Simnet, + /** + * Bitcoin signet + */ LDKCurrency_Signet, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/Level.java b/src/main/java/org/ldk/enums/Level.java index e066ac32..f278da87 100644 --- a/src/main/java/org/ldk/enums/Level.java +++ b/src/main/java/org/ldk/enums/Level.java @@ -4,10 +4,25 @@ package org.ldk.enums; * An enum representing the available verbosity levels of the logger. */ public enum Level { + /** + * Designates very low priority, often extremely verbose, information + */ LDKLevel_Trace, + /** + * Designates lower priority information + */ LDKLevel_Debug, + /** + * Designates useful information + */ LDKLevel_Info, + /** + * Designates hazardous situations + */ LDKLevel_Warn, + /** + * Designates very serious errors + */ LDKLevel_Error, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/Network.java b/src/main/java/org/ldk/enums/Network.java index 686f21e8..ce377958 100644 --- a/src/main/java/org/ldk/enums/Network.java +++ b/src/main/java/org/ldk/enums/Network.java @@ -4,9 +4,21 @@ package org.ldk.enums; * An enum representing the possible Bitcoin or test networks which we can run on */ public enum Network { + /** + * The main Bitcoin blockchain. + */ LDKNetwork_Bitcoin, + /** + * The testnet3 blockchain. + */ LDKNetwork_Testnet, + /** + * A local test blockchain. + */ LDKNetwork_Regtest, + /** + * A blockchain on which blocks are signed instead of mined. + */ LDKNetwork_Signet, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/Secp256k1Error.java b/src/main/java/org/ldk/enums/Secp256k1Error.java index 597c73fc..cca53632 100644 --- a/src/main/java/org/ldk/enums/Secp256k1Error.java +++ b/src/main/java/org/ldk/enums/Secp256k1Error.java @@ -4,14 +4,41 @@ package org.ldk.enums; * Represents an error returned from libsecp256k1 during validation of some secp256k1 data */ public enum Secp256k1Error { + /** + * Signature failed verification + */ LDKSecp256k1Error_IncorrectSignature, + /** + * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant) + */ LDKSecp256k1Error_InvalidMessage, + /** + * Bad public key + */ LDKSecp256k1Error_InvalidPublicKey, + /** + * Bad signature + */ LDKSecp256k1Error_InvalidSignature, + /** + * Bad secret key + */ LDKSecp256k1Error_InvalidSecretKey, + /** + * Bad recovery id + */ LDKSecp256k1Error_InvalidRecoveryId, + /** + * Invalid tweak for add_assign or mul_assign + */ LDKSecp256k1Error_InvalidTweak, + /** + * tweak_add_check failed on an xonly public key + */ LDKSecp256k1Error_TweakCheckFailed, + /** + * Didn't pass enough memory to context creation with preallocated memory + */ LDKSecp256k1Error_NotEnoughMemory, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/SemanticError.java b/src/main/java/org/ldk/enums/SemanticError.java index 96023bd2..57f659ff 100644 --- a/src/main/java/org/ldk/enums/SemanticError.java +++ b/src/main/java/org/ldk/enums/SemanticError.java @@ -5,15 +5,46 @@ package org.ldk.enums; * requirements sections in BOLT #11 */ public enum SemanticError { + /** + * The invoice is missing the mandatory payment hash + */ LDKSemanticError_NoPaymentHash, + /** + * The invoice has multiple payment hashes which isn't allowed + */ LDKSemanticError_MultiplePaymentHashes, + /** + * No description or description hash are part of the invoice + */ LDKSemanticError_NoDescription, + /** + * The invoice contains multiple descriptions and/or description hashes which isn't allowed + */ LDKSemanticError_MultipleDescriptions, + /** + * The invoice is missing the mandatory payment secret, which all modern lightning nodes + * should provide. + */ LDKSemanticError_NoPaymentSecret, + /** + * The invoice contains multiple payment secrets + */ LDKSemanticError_MultiplePaymentSecrets, + /** + * The invoice's features are invalid + */ LDKSemanticError_InvalidFeatures, + /** + * The recovery id doesn't fit the signature/pub key + */ LDKSemanticError_InvalidRecoveryId, + /** + * The invoice's signature is invalid + */ LDKSemanticError_InvalidSignature, + /** + * The invoice's amount was not a whole number of millisatoshis + */ LDKSemanticError_ImpreciseAmount, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/enums/SiPrefix.java b/src/main/java/org/ldk/enums/SiPrefix.java index c1b167a6..319da34e 100644 --- a/src/main/java/org/ldk/enums/SiPrefix.java +++ b/src/main/java/org/ldk/enums/SiPrefix.java @@ -4,9 +4,21 @@ package org.ldk.enums; * SI prefixes for the human readable part */ public enum SiPrefix { + /** + * 10^-3 + */ LDKSiPrefix_Milli, + /** + * 10^-6 + */ LDKSiPrefix_Micro, + /** + * 10^-9 + */ LDKSiPrefix_Nano, + /** + * 10^-12 + */ LDKSiPrefix_Pico, ; static native void init(); static { init(); } diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 99e579fb..5e797304 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -77,24 +77,18 @@ public class bindings { static { Secp256k1Error.values(); /* Force enum statics to run */ } static { SemanticError.values(); /* Force enum statics to run */ } static { SiPrefix.values(); /* Force enum statics to run */ } - public static native long LDKCVec_u8Z_new(byte[] elems); // struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) public static native byte[] TxOut_get_script_pubkey(long thing); // uint64_t TxOut_get_value (struct LDKTxOut* thing) public static native long TxOut_get_value(long thing); - public static native boolean LDKCResult_SecretKeyErrorZ_result_ok(long arg); public static native byte[] LDKCResult_SecretKeyErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_SecretKeyErrorZ_get_err(long arg); - public static native boolean LDKCResult_PublicKeyErrorZ_result_ok(long arg); public static native byte[] LDKCResult_PublicKeyErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_PublicKeyErrorZ_get_err(long arg); - public static native boolean LDKCResult_TxCreationKeysDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_TxCreationKeysDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_TxCreationKeysDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelPublicKeysDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelPublicKeysDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_TxCreationKeysErrorZ_result_ok(long arg); public static native long LDKCResult_TxCreationKeysErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_TxCreationKeysErrorZ_get_err(long arg); public static class LDKCOption_u32Z { @@ -110,53 +104,36 @@ public class bindings { } static { LDKCOption_u32Z.init(); } public static native LDKCOption_u32Z LDKCOption_u32Z_ref_from_ptr(long ptr); - public static native boolean LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_TrustedClosingTransactionNoneZ_result_ok(long arg); public static native long LDKCResult_TrustedClosingTransactionNoneZ_get_ok(long arg); public static native void LDKCResult_TrustedClosingTransactionNoneZ_get_err(long arg); - public static native boolean LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_CommitmentTransactionDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(long arg); public static native long LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(long arg); public static native void LDKCResult_TrustedCommitmentTransactionNoneZ_get_err(long arg); - public static native boolean LDKCResult_CVec_SignatureZNoneZ_result_ok(long arg); public static native byte[][] LDKCResult_CVec_SignatureZNoneZ_get_ok(long arg); public static native void LDKCResult_CVec_SignatureZNoneZ_get_err(long arg); - public static native boolean LDKCResult_ShutdownScriptDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ShutdownScriptDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ShutdownScriptDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(long arg); public static native long LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(long arg); public static native long LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_err(long arg); - public static native boolean LDKCResult_NoneErrorZ_result_ok(long arg); public static native void LDKCResult_NoneErrorZ_get_ok(long arg); public static native IOError LDKCResult_NoneErrorZ_get_err(long arg); - public static native boolean LDKCResult_RouteHopDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_RouteHopDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_RouteHopDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_RouteHopZ_new(long[] elems); - public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_RouteDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_RouteDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RouteParametersDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_RouteParametersDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_RouteParametersDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_RouteHintZ_new(long[] elems); public static class LDKCOption_u64Z { private LDKCOption_u64Z() {} public final static class Some extends LDKCOption_u64Z { @@ -170,29 +147,20 @@ public class bindings { } static { LDKCOption_u64Z.init(); } public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr); - public static native boolean LDKCResult_PayeeDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_PayeeDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_PayeeDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_RouteHintHopZ_new(long[] elems); - public static native boolean LDKCResult_RouteHintDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_RouteHintDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_RouteHintDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RouteHintHopDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_RouteHintHopDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_RouteHintHopDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_ChannelDetailsZ_new(long[] elems); - public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg); public static native long LDKCResult_RouteLightningErrorZ_get_ok(long arg); public static native long LDKCResult_RouteLightningErrorZ_get_err(long arg); - public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg); public static native long LDKCResult_TxOutAccessErrorZ_get_ok(long arg); public static native AccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg); // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple); public static native long C2Tuple_usizeTransactionZ_get_a(long tuple); // struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_usizeTransactionZ_get_b(long tuple); - public static native long LDKCVec_C2Tuple_usizeTransactionZZ_new(long[] elems); - public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg); public static native void LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg); public static native ChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg); public static class LDKMonitorEvent { @@ -218,7 +186,6 @@ public class bindings { } static { LDKMonitorEvent.init(); } public static native LDKMonitorEvent LDKMonitorEvent_ref_from_ptr(long ptr); - public static native long LDKCVec_MonitorEventZ_new(long[] elems); public static class LDKCOption_C2Tuple_usizeTransactionZZ { private LDKCOption_C2Tuple_usizeTransactionZZ() {} public final static class Some extends LDKCOption_C2Tuple_usizeTransactionZZ { @@ -232,6 +199,50 @@ public class bindings { } static { LDKCOption_C2Tuple_usizeTransactionZZ.init(); } public static native LDKCOption_C2Tuple_usizeTransactionZZ LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(long ptr); + public static class LDKClosureReason { + private LDKClosureReason() {} + public final static class CounterpartyForceClosed extends LDKClosureReason { + public String peer_msg; + CounterpartyForceClosed(String peer_msg) { this.peer_msg = peer_msg; } + } + public final static class HolderForceClosed extends LDKClosureReason { + HolderForceClosed() { } + } + public final static class CooperativeClosure extends LDKClosureReason { + CooperativeClosure() { } + } + public final static class CommitmentTxConfirmed extends LDKClosureReason { + CommitmentTxConfirmed() { } + } + public final static class ProcessingError extends LDKClosureReason { + public String err; + ProcessingError(String err) { this.err = err; } + } + public final static class DisconnectedPeer extends LDKClosureReason { + DisconnectedPeer() { } + } + public final static class OutdatedChannelManager extends LDKClosureReason { + OutdatedChannelManager() { } + } + static native void init(); + } + static { LDKClosureReason.init(); } + public static native LDKClosureReason LDKClosureReason_ref_from_ptr(long ptr); + public static class LDKCOption_ClosureReasonZ { + private LDKCOption_ClosureReasonZ() {} + public final static class Some extends LDKCOption_ClosureReasonZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_ClosureReasonZ { + None() { } + } + static native void init(); + } + static { LDKCOption_ClosureReasonZ.init(); } + public static native LDKCOption_ClosureReasonZ LDKCOption_ClosureReasonZ_ref_from_ptr(long ptr); + public static native long LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_err(long arg); public static class LDKNetworkUpdate { private LDKNetworkUpdate() {} public final static class ChannelUpdateMessage extends LDKNetworkUpdate { @@ -284,7 +295,98 @@ public class bindings { } static { LDKSpendableOutputDescriptor.init(); } public static native LDKSpendableOutputDescriptor LDKSpendableOutputDescriptor_ref_from_ptr(long ptr); - public static native long LDKCVec_SpendableOutputDescriptorZ_new(long[] elems); + public static class LDKPaymentPurpose { + private LDKPaymentPurpose() {} + public final static class InvoicePayment extends LDKPaymentPurpose { + public byte[] payment_preimage; + public byte[] payment_secret; + public long user_payment_id; + InvoicePayment(byte[] payment_preimage, byte[] payment_secret, long user_payment_id) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.user_payment_id = user_payment_id; } + } + public final static class SpontaneousPayment extends LDKPaymentPurpose { + public byte[] spontaneous_payment; + SpontaneousPayment(byte[] spontaneous_payment) { this.spontaneous_payment = spontaneous_payment; } + } + static native void init(); + } + static { LDKPaymentPurpose.init(); } + public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr); + public static class LDKEvent { + private LDKEvent() {} + public final static class FundingGenerationReady extends LDKEvent { + public byte[] temporary_channel_id; + public long channel_value_satoshis; + public byte[] output_script; + public long user_channel_id; + FundingGenerationReady(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } + } + public final static class PaymentReceived extends LDKEvent { + public byte[] payment_hash; + public long amt; + public long purpose; + PaymentReceived(byte[] payment_hash, long amt, long purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; } + } + public final static class PaymentSent extends LDKEvent { + public byte[] payment_id; + public byte[] payment_preimage; + public byte[] payment_hash; + public long fee_paid_msat; + PaymentSent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, long fee_paid_msat) { this.payment_id = payment_id; this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; this.fee_paid_msat = fee_paid_msat; } + } + public final static class PaymentPathFailed extends LDKEvent { + public byte[] payment_id; + public byte[] payment_hash; + public boolean rejected_by_dest; + public long network_update; + public boolean all_paths_failed; + public long[] path; + public long short_channel_id; + public long retry; + PaymentPathFailed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_id, long retry) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; this.network_update = network_update; this.all_paths_failed = all_paths_failed; this.path = path; this.short_channel_id = short_channel_id; this.retry = retry; } + } + public final static class PendingHTLCsForwardable extends LDKEvent { + public long time_forwardable; + PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; } + } + public final static class SpendableOutputs extends LDKEvent { + public long[] outputs; + SpendableOutputs(long[] outputs) { this.outputs = outputs; } + } + public final static class PaymentForwarded extends LDKEvent { + public long fee_earned_msat; + public boolean claim_from_onchain_tx; + PaymentForwarded(long fee_earned_msat, boolean claim_from_onchain_tx) { this.fee_earned_msat = fee_earned_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; } + } + public final static class ChannelClosed extends LDKEvent { + public byte[] channel_id; + public long user_channel_id; + public long reason; + ChannelClosed(byte[] channel_id, long user_channel_id, long reason) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; } + } + public final static class DiscardFunding extends LDKEvent { + public byte[] channel_id; + public byte[] transaction; + DiscardFunding(byte[] channel_id, byte[] transaction) { this.channel_id = channel_id; this.transaction = transaction; } + } + static native void init(); + } + static { LDKEvent.init(); } + public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); + public static class LDKCOption_EventZ { + private LDKCOption_EventZ() {} + public final static class Some extends LDKCOption_EventZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_EventZ { + None() { } + } + static native void init(); + } + static { LDKCOption_EventZ.init(); } + public static native LDKCOption_EventZ LDKCOption_EventZ_ref_from_ptr(long ptr); + public static native long LDKCResult_COption_EventZDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_COption_EventZDecodeErrorZ_get_err(long arg); public static class LDKErrorAction { private LDKErrorAction() {} public final static class DisconnectPeer extends LDKErrorAction { @@ -405,45 +507,32 @@ public class bindings { } static { LDKMessageSendEvent.init(); } public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr); - public static native long LDKCVec_MessageSendEventZ_new(long[] elems); - public static native boolean LDKCResult_InitFeaturesDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_InitFeaturesDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_InitFeaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_NodeFeaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ScoringParametersDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ScoringParametersDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ScoringParametersDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ScorerDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ScorerDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ScorerDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NoneNoneZ_result_ok(long arg); public static native void LDKCResult_NoneNoneZ_get_ok(long arg); public static native void LDKCResult_NoneNoneZ_get_err(long arg); // struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_SignatureCVec_SignatureZZ_get_a(long tuple); // struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple); public static native byte[][] C2Tuple_SignatureCVec_SignatureZZ_get_b(long tuple); - public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg); public static native long LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long arg); public static native void LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long arg); - public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg); public static native byte[] LDKCResult_SignatureNoneZ_get_ok(long arg); public static native void LDKCResult_SignatureNoneZ_get_err(long arg); public interface LDKBaseSign { @@ -497,28 +586,20 @@ public class bindings { public static native long LDKSign_get_BaseSign(long arg); // LDKCVec_u8Z Sign_write LDKSign *NONNULL_PTR this_arg public static native byte[] Sign_write(long this_arg); - public static native boolean LDKCResult_SignDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_SignDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_SignDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RecoverableSignatureNoneZ_result_ok(long arg); public static native byte[] LDKCResult_RecoverableSignatureNoneZ_get_ok(long arg); public static native void LDKCResult_RecoverableSignatureNoneZ_get_err(long arg); - public static native boolean LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(long arg); public static native byte[][] LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(long arg); public static native void LDKCResult_CVec_CVec_u8ZZNoneZ_get_err(long arg); - public static native boolean LDKCResult_InMemorySignerDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_InMemorySignerDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_InMemorySignerDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_TxOutZ_new(long[] elems); - public static native boolean LDKCResult_TransactionNoneZ_result_ok(long arg); public static native byte[] LDKCResult_TransactionNoneZ_get_ok(long arg); public static native void LDKCResult_TransactionNoneZ_get_err(long arg); // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_BlockHashChannelMonitorZ_get_a(long tuple); // struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple); public static native long C2Tuple_BlockHashChannelMonitorZ_get_b(long tuple); - public static native long LDKCVec_C2Tuple_BlockHashChannelMonitorZZ_new(long[] elems); - public static native boolean LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(long arg); public static native long[] LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(long arg); public static native IOError LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(long arg); public static class LDKCOption_u16Z { @@ -564,12 +645,8 @@ public class bindings { } static { LDKAPIError.init(); } public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr); - public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg); public static native void LDKCResult_NoneAPIErrorZ_get_ok(long arg); public static native long LDKCResult_NoneAPIErrorZ_get_err(long arg); - public static native long LDKCVec_CResult_NoneAPIErrorZZ_new(long[] elems); - public static native long LDKCVec_APIErrorZ_new(long[] elems); - public static native boolean LDKCResult__u832APIErrorZ_result_ok(long arg); public static native byte[] LDKCResult__u832APIErrorZ_get_ok(long arg); public static native long LDKCResult__u832APIErrorZ_get_err(long arg); public static class LDKPaymentSendFailure { @@ -596,17 +673,14 @@ public class bindings { } static { LDKPaymentSendFailure.init(); } public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr); - public static native boolean LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(long arg); public static native byte[] LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(long arg); public static native long LDKCResult_PaymentIdPaymentSendFailureZ_get_err(long arg); - public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg); public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg); public static native long LDKCResult_NonePaymentSendFailureZ_get_err(long arg); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_PaymentHashPaymentIdZ_get_a(long tuple); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_PaymentHashPaymentIdZ_get_b(long tuple); - public static native boolean LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(long arg); public static native long LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(long arg); public static native long LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(long arg); public static class LDKNetAddress { @@ -637,15 +711,12 @@ public class bindings { } static { LDKNetAddress.init(); } public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); - public static native long LDKCVec_NetAddressZ_new(long[] elems); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_PaymentHashPaymentSecretZ_get_a(long tuple); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_PaymentHashPaymentSecretZ_get_b(long tuple); - public static native boolean LDKCResult_PaymentSecretAPIErrorZ_result_ok(long arg); public static native byte[] LDKCResult_PaymentSecretAPIErrorZ_get_ok(long arg); public static native long LDKCResult_PaymentSecretAPIErrorZ_get_err(long arg); - public static native long LDKCVec_ChannelMonitorZ_new(long[] elems); public interface LDKWatch { long watch_channel(long funding_txo, long monitor); long update_channel(long funding_txo, long update); @@ -695,20 +766,17 @@ public class bindings { // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator *NONNULL_PTR this_arg, enum LDKConfirmationTarget confirmation_target public static native int FeeEstimator_get_est_sat_per_1000_weight(long this_arg, ConfirmationTarget confirmation_target); public interface LDKLogger { - void log(String record); + void log(long record); } public static native long LDKLogger_new(LDKLogger impl); // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_BlockHashChannelManagerZ_get_a(long tuple); // struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple); public static native long C2Tuple_BlockHashChannelManagerZ_get_b(long tuple); - public static native boolean LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelConfigDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelConfigDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelConfigDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_OutPointDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_OutPointDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_OutPointDecodeErrorZ_get_err(long arg); public interface LDKType { @@ -736,7 +804,6 @@ public class bindings { } static { LDKCOption_TypeZ.init(); } public static native LDKCOption_TypeZ LDKCOption_TypeZ_ref_from_ptr(long ptr); - public static native boolean LDKCResult_COption_TypeZDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_COption_TypeZDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_COption_TypeZDecodeErrorZ_get_err(long arg); public static class LDKPaymentError { @@ -757,16 +824,12 @@ public class bindings { } static { LDKPaymentError.init(); } public static native LDKPaymentError LDKPaymentError_ref_from_ptr(long ptr); - public static native boolean LDKCResult_PaymentIdPaymentErrorZ_result_ok(long arg); public static native byte[] LDKCResult_PaymentIdPaymentErrorZ_get_ok(long arg); public static native long LDKCResult_PaymentIdPaymentErrorZ_get_err(long arg); - public static native boolean LDKCResult_SiPrefixNoneZ_result_ok(long arg); public static native SiPrefix LDKCResult_SiPrefixNoneZ_get_ok(long arg); public static native void LDKCResult_SiPrefixNoneZ_get_err(long arg); - public static native boolean LDKCResult_InvoiceNoneZ_result_ok(long arg); public static native long LDKCResult_InvoiceNoneZ_get_ok(long arg); public static native void LDKCResult_InvoiceNoneZ_get_err(long arg); - public static native boolean LDKCResult_SignedRawInvoiceNoneZ_result_ok(long arg); public static native long LDKCResult_SignedRawInvoiceNoneZ_get_ok(long arg); public static native void LDKCResult_SignedRawInvoiceNoneZ_get_err(long arg); // struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple); @@ -775,38 +838,41 @@ public class bindings { public static native byte[] C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(long tuple); // struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple); public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(long tuple); - public static native boolean LDKCResult_PayeePubKeyErrorZ_result_ok(long arg); public static native long LDKCResult_PayeePubKeyErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_PayeePubKeyErrorZ_get_err(long arg); - public static native long LDKCVec_PrivateRouteZ_new(long[] elems); - public static native boolean LDKCResult_PositiveTimestampCreationErrorZ_result_ok(long arg); public static native long LDKCResult_PositiveTimestampCreationErrorZ_get_ok(long arg); public static native CreationError LDKCResult_PositiveTimestampCreationErrorZ_get_err(long arg); - public static native boolean LDKCResult_NoneSemanticErrorZ_result_ok(long arg); public static native void LDKCResult_NoneSemanticErrorZ_get_ok(long arg); public static native SemanticError LDKCResult_NoneSemanticErrorZ_get_err(long arg); - public static native boolean LDKCResult_InvoiceSemanticErrorZ_result_ok(long arg); public static native long LDKCResult_InvoiceSemanticErrorZ_get_ok(long arg); public static native SemanticError LDKCResult_InvoiceSemanticErrorZ_get_err(long arg); - public static native boolean LDKCResult_DescriptionCreationErrorZ_result_ok(long arg); public static native long LDKCResult_DescriptionCreationErrorZ_get_ok(long arg); public static native CreationError LDKCResult_DescriptionCreationErrorZ_get_err(long arg); - public static native boolean LDKCResult_ExpiryTimeCreationErrorZ_result_ok(long arg); public static native long LDKCResult_ExpiryTimeCreationErrorZ_get_ok(long arg); public static native CreationError LDKCResult_ExpiryTimeCreationErrorZ_get_err(long arg); - public static native boolean LDKCResult_PrivateRouteCreationErrorZ_result_ok(long arg); public static native long LDKCResult_PrivateRouteCreationErrorZ_get_ok(long arg); public static native CreationError LDKCResult_PrivateRouteCreationErrorZ_get_err(long arg); - public static native boolean LDKCResult_StringErrorZ_result_ok(long arg); public static native String LDKCResult_StringErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_StringErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(long arg); + public static class LDKCOption_MonitorEventZ { + private LDKCOption_MonitorEventZ() {} + public final static class Some extends LDKCOption_MonitorEventZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_MonitorEventZ { + None() { } + } + static native void init(); + } + static { LDKCOption_MonitorEventZ.init(); } + public static native LDKCOption_MonitorEventZ LDKCOption_MonitorEventZ_ref_from_ptr(long ptr); + public static native long LDKCResult_COption_MonitorEventZDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err(long arg); public static native long LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_HTLCUpdateDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg); public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg); public static native long LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg); // struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple); @@ -817,129 +883,18 @@ public class bindings { public static native int C2Tuple_u32ScriptZ_get_a(long tuple); // struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_u32ScriptZ_get_b(long tuple); - public static native long LDKCVec_C2Tuple_u32ScriptZZ_new(long[] elems); // struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(long tuple); // struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple); public static native long[] C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(long tuple); - public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(long[] elems); - public static class LDKPaymentPurpose { - private LDKPaymentPurpose() {} - public final static class InvoicePayment extends LDKPaymentPurpose { - public byte[] payment_preimage; - public byte[] payment_secret; - public long user_payment_id; - InvoicePayment(byte[] payment_preimage, byte[] payment_secret, long user_payment_id) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.user_payment_id = user_payment_id; } - } - public final static class SpontaneousPayment extends LDKPaymentPurpose { - public byte[] spontaneous_payment; - SpontaneousPayment(byte[] spontaneous_payment) { this.spontaneous_payment = spontaneous_payment; } - } - static native void init(); - } - static { LDKPaymentPurpose.init(); } - public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr); - public static class LDKClosureReason { - private LDKClosureReason() {} - public final static class CounterpartyForceClosed extends LDKClosureReason { - public String peer_msg; - CounterpartyForceClosed(String peer_msg) { this.peer_msg = peer_msg; } - } - public final static class HolderForceClosed extends LDKClosureReason { - HolderForceClosed() { } - } - public final static class CooperativeClosure extends LDKClosureReason { - CooperativeClosure() { } - } - public final static class CommitmentTxConfirmed extends LDKClosureReason { - CommitmentTxConfirmed() { } - } - public final static class ProcessingError extends LDKClosureReason { - public String err; - ProcessingError(String err) { this.err = err; } - } - public final static class DisconnectedPeer extends LDKClosureReason { - DisconnectedPeer() { } - } - public final static class OutdatedChannelManager extends LDKClosureReason { - OutdatedChannelManager() { } - } - static native void init(); - } - static { LDKClosureReason.init(); } - public static native LDKClosureReason LDKClosureReason_ref_from_ptr(long ptr); - public static class LDKEvent { - private LDKEvent() {} - public final static class FundingGenerationReady extends LDKEvent { - public byte[] temporary_channel_id; - public long channel_value_satoshis; - public byte[] output_script; - public long user_channel_id; - FundingGenerationReady(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } - } - public final static class PaymentReceived extends LDKEvent { - public byte[] payment_hash; - public long amt; - public long purpose; - PaymentReceived(byte[] payment_hash, long amt, long purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; } - } - public final static class PaymentSent extends LDKEvent { - public byte[] payment_id; - public byte[] payment_preimage; - public byte[] payment_hash; - public long fee_paid_msat; - PaymentSent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, long fee_paid_msat) { this.payment_id = payment_id; this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; this.fee_paid_msat = fee_paid_msat; } - } - public final static class PaymentPathFailed extends LDKEvent { - public byte[] payment_id; - public byte[] payment_hash; - public boolean rejected_by_dest; - public long network_update; - public boolean all_paths_failed; - public long[] path; - public long short_channel_id; - public long retry; - PaymentPathFailed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_id, long retry) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; this.network_update = network_update; this.all_paths_failed = all_paths_failed; this.path = path; this.short_channel_id = short_channel_id; this.retry = retry; } - } - public final static class PendingHTLCsForwardable extends LDKEvent { - public long time_forwardable; - PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; } - } - public final static class SpendableOutputs extends LDKEvent { - public long[] outputs; - SpendableOutputs(long[] outputs) { this.outputs = outputs; } - } - public final static class PaymentForwarded extends LDKEvent { - public long fee_earned_msat; - public boolean claim_from_onchain_tx; - PaymentForwarded(long fee_earned_msat, boolean claim_from_onchain_tx) { this.fee_earned_msat = fee_earned_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; } - } - public final static class ChannelClosed extends LDKEvent { - public byte[] channel_id; - public long user_channel_id; - public long reason; - ChannelClosed(byte[] channel_id, long user_channel_id, long reason) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; } - } - public final static class DiscardFunding extends LDKEvent { - public byte[] channel_id; - public byte[] transaction; - DiscardFunding(byte[] channel_id, byte[] transaction) { this.channel_id = channel_id; this.transaction = transaction; } - } - static native void init(); - } - static { LDKEvent.init(); } - public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); - public static native long LDKCVec_EventZ_new(long[] elems); // uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple); public static native int C2Tuple_u32TxOutZ_get_a(long tuple); // struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple); public static native long C2Tuple_u32TxOutZ_get_b(long tuple); - public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(long[] elems); // struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(long tuple); // struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple); public static native long[] C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(long tuple); - public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(long[] elems); public static class LDKBalance { private LDKBalance() {} public final static class ClaimableOnChannelClose extends LDKBalance { @@ -965,19 +920,14 @@ public class bindings { } static { LDKBalance.init(); } public static native LDKBalance LDKBalance_ref_from_ptr(long ptr); - public static native long LDKCVec_BalanceZ_new(long[] elems); - public static native boolean LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NoneLightningErrorZ_result_ok(long arg); public static native void LDKCResult_NoneLightningErrorZ_get_ok(long arg); public static native long LDKCResult_NoneLightningErrorZ_get_err(long arg); // struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple); public static native byte[] C2Tuple_PublicKeyTypeZ_get_a(long tuple); // struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple); public static native long C2Tuple_PublicKeyTypeZ_get_b(long tuple); - public static native long LDKCVec_C2Tuple_PublicKeyTypeZZ_new(long[] elems); - public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg); public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg); public static native long LDKCResult_boolLightningErrorZ_get_err(long arg); // struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple); @@ -986,20 +936,16 @@ public class bindings { public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long tuple); // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple); public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long tuple); - public static native long LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(long[] elems); - public static native long LDKCVec_NodeAnnouncementZ_new(long[] elems); - public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg); public static native byte[] LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(long arg); public static native long LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg); public static native void LDKCResult_NonePeerHandleErrorZ_get_ok(long arg); public static native long LDKCResult_NonePeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg); public static native boolean LDKCResult_boolPeerHandleErrorZ_get_ok(long arg); public static native long LDKCResult_boolPeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeIdDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_NodeIdDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_NodeIdDecodeErrorZ_get_err(long arg); + public static native long LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(long arg); + public static native long LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_err(long arg); public interface LDKAccess { long get_utxo(byte[] genesis_hash, long short_channel_id); } @@ -1019,23 +965,16 @@ public class bindings { } static { LDKCOption_AccessZ.init(); } public static native LDKCOption_AccessZ LDKCOption_AccessZ_ref_from_ptr(long ptr); - public static native boolean LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelInfoDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelInfoDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelInfoDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RoutingFeesDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_RoutingFeesDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_RoutingFeesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_u64Z_new(long[] elems); - public static native boolean LDKCResult_NodeInfoDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_NodeInfoDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_NodeInfoDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NetworkGraphDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_NetworkGraphDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_NetworkGraphDecodeErrorZ_get_err(long arg); public static class LDKCOption_CVec_NetAddressZZ { @@ -1051,107 +990,70 @@ public class bindings { } static { LDKCOption_CVec_NetAddressZZ.init(); } public static native LDKCOption_CVec_NetAddressZZ LDKCOption_CVec_NetAddressZZ_ref_from_ptr(long ptr); - public static native boolean LDKCResult_NetAddressDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_NetAddressDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_NetAddressDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_UpdateAddHTLCZ_new(long[] elems); - public static native long LDKCVec_UpdateFulfillHTLCZ_new(long[] elems); - public static native long LDKCVec_UpdateFailHTLCZ_new(long[] elems); - public static native long LDKCVec_UpdateFailMalformedHTLCZ_new(long[] elems); - public static native boolean LDKCResult_AcceptChannelDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_AcceptChannelDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_AcceptChannelDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelReestablishDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ClosingSignedDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ClosingSignedDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ClosingSignedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_CommitmentSignedDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_CommitmentSignedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_FundingCreatedDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_FundingCreatedDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_FundingCreatedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_FundingSignedDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_FundingSignedDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_FundingSignedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_FundingLockedDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_FundingLockedDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_FundingLockedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_InitDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_InitDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_InitDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_OpenChannelDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_OpenChannelDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_OpenChannelDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_RevokeAndACKDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_RevokeAndACKDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ShutdownDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ShutdownDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ShutdownDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_UpdateFailHTLCDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_UpdateFailHTLCDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateFeeDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_UpdateFeeDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_UpdateFeeDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_UpdateAddHTLCDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_UpdateAddHTLCDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_PingDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_PingDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_PingDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_PongDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_PongDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_PongDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelAnnouncementDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelAnnouncementDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ChannelUpdateDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ChannelUpdateDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ErrorMessageDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ErrorMessageDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ErrorMessageDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_NodeAnnouncementDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_NodeAnnouncementDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(long arg); public static native long LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(long arg); public static native long LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(long arg); public static class LDKSignOrCreationError { @@ -1167,7 +1069,6 @@ public class bindings { } static { LDKSignOrCreationError.init(); } public static native LDKSignOrCreationError LDKSignOrCreationError_ref_from_ptr(long ptr); - public static native boolean LDKCResult_InvoiceSignOrCreationErrorZ_result_ok(long arg); public static native long LDKCResult_InvoiceSignOrCreationErrorZ_get_ok(long arg); public static native long LDKCResult_InvoiceSignOrCreationErrorZ_get_err(long arg); public interface LDKFilter { @@ -1192,10 +1093,8 @@ public class bindings { } static { LDKCOption_FilterZ.init(); } public static native LDKCOption_FilterZ LDKCOption_FilterZ_ref_from_ptr(long ptr); - public static native boolean LDKCResult_LockedChannelMonitorNoneZ_result_ok(long arg); public static native long LDKCResult_LockedChannelMonitorNoneZ_get_ok(long arg); public static native void LDKCResult_LockedChannelMonitorNoneZ_get_err(long arg); - public static native long LDKCVec_OutPointZ_new(long[] elems); public interface LDKMessageSendEventsProvider { long[] get_and_clear_pending_msg_events(); } @@ -1442,6 +1341,8 @@ public class bindings { public static native long TxOut_new(byte[] script_pubkey, long value); // void TxOut_free(struct LDKTxOut _res); public static native void TxOut_free(long _res); + // uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg); + public static native long TxOut_clone_ptr(long arg); // struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig); public static native long TxOut_clone(long orig); // void Str_free(struct LDKStr _res); @@ -1450,38 +1351,56 @@ public class bindings { public static native long CResult_SecretKeyErrorZ_ok(byte[] o); // struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e); public static native long CResult_SecretKeyErrorZ_err(Secp256k1Error e); + // bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o); + public static native boolean CResult_SecretKeyErrorZ_is_ok(long o); // void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res); public static native void CResult_SecretKeyErrorZ_free(long _res); // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o); public static native long CResult_PublicKeyErrorZ_ok(byte[] o); // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e); public static native long CResult_PublicKeyErrorZ_err(Secp256k1Error e); + // bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o); + public static native boolean CResult_PublicKeyErrorZ_is_ok(long o); // void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); public static native void CResult_PublicKeyErrorZ_free(long _res); + // uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg); + public static native long CResult_PublicKeyErrorZ_clone_ptr(long arg); // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig); public static native long CResult_PublicKeyErrorZ_clone(long orig); // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o); public static native long CResult_TxCreationKeysDecodeErrorZ_ok(long o); // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_TxCreationKeysDecodeErrorZ_err(long e); + // bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_TxCreationKeysDecodeErrorZ_is_ok(long o); // void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res); public static native void CResult_TxCreationKeysDecodeErrorZ_free(long _res); + // uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_TxCreationKeysDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_TxCreationKeysDecodeErrorZ_clone(long orig); // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o); public static native long CResult_ChannelPublicKeysDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelPublicKeysDecodeErrorZ_err(long e); + // bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelPublicKeysDecodeErrorZ_is_ok(long o); // void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res); public static native void CResult_ChannelPublicKeysDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelPublicKeysDecodeErrorZ_clone(long orig); // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o); public static native long CResult_TxCreationKeysErrorZ_ok(long o); // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e); public static native long CResult_TxCreationKeysErrorZ_err(Secp256k1Error e); + // bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o); + public static native boolean CResult_TxCreationKeysErrorZ_is_ok(long o); // void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res); public static native void CResult_TxCreationKeysErrorZ_free(long _res); + // uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg); + public static native long CResult_TxCreationKeysErrorZ_clone_ptr(long arg); // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig); public static native long CResult_TxCreationKeysErrorZ_clone(long orig); // struct LDKCOption_u32Z COption_u32Z_some(uint32_t o); @@ -1490,30 +1409,44 @@ public class bindings { public static native long COption_u32Z_none(); // void COption_u32Z_free(struct LDKCOption_u32Z _res); public static native void COption_u32Z_free(long _res); + // uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg); + public static native long COption_u32Z_clone_ptr(long arg); // struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig); public static native long COption_u32Z_clone(long orig); // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o); public static native long CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(long o); // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_HTLCOutputInCommitmentDecodeErrorZ_err(long e); + // bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(long o); // void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res); public static native void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(long _res); + // uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(long orig); // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o); public static native long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(long o); // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(long e); + // bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(long o); // void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res); public static native void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(long _res); + // uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(long orig); // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o); public static native long CResult_ChannelTransactionParametersDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelTransactionParametersDecodeErrorZ_err(long e); + // bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(long o); // void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res); public static native void CResult_ChannelTransactionParametersDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelTransactionParametersDecodeErrorZ_clone(long orig); // void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); @@ -1522,76 +1455,112 @@ public class bindings { public static native long CResult_HolderCommitmentTransactionDecodeErrorZ_ok(long o); // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_HolderCommitmentTransactionDecodeErrorZ_err(long e); + // bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(long o); // void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res); public static native void CResult_HolderCommitmentTransactionDecodeErrorZ_free(long _res); + // uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_HolderCommitmentTransactionDecodeErrorZ_clone(long orig); // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o); public static native long CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(long o); // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_BuiltCommitmentTransactionDecodeErrorZ_err(long e); + // bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(long o); // void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res); public static native void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(long _res); + // uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(long orig); // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o); public static native long CResult_TrustedClosingTransactionNoneZ_ok(long o); // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void); public static native long CResult_TrustedClosingTransactionNoneZ_err(); + // bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o); + public static native boolean CResult_TrustedClosingTransactionNoneZ_is_ok(long o); // void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res); public static native void CResult_TrustedClosingTransactionNoneZ_free(long _res); // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o); public static native long CResult_CommitmentTransactionDecodeErrorZ_ok(long o); // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_CommitmentTransactionDecodeErrorZ_err(long e); + // bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_CommitmentTransactionDecodeErrorZ_is_ok(long o); // void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res); public static native void CResult_CommitmentTransactionDecodeErrorZ_free(long _res); + // uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_CommitmentTransactionDecodeErrorZ_clone(long orig); // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); public static native long CResult_TrustedCommitmentTransactionNoneZ_ok(long o); // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void); public static native long CResult_TrustedCommitmentTransactionNoneZ_err(); + // bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o); + public static native boolean CResult_TrustedCommitmentTransactionNoneZ_is_ok(long o); // void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); public static native void CResult_TrustedCommitmentTransactionNoneZ_free(long _res); // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o); public static native long CResult_CVec_SignatureZNoneZ_ok(byte[][] o); // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); public static native long CResult_CVec_SignatureZNoneZ_err(); + // bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o); + public static native boolean CResult_CVec_SignatureZNoneZ_is_ok(long o); // void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); public static native void CResult_CVec_SignatureZNoneZ_free(long _res); + // uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg); + public static native long CResult_CVec_SignatureZNoneZ_clone_ptr(long arg); // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig); public static native long CResult_CVec_SignatureZNoneZ_clone(long orig); // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o); public static native long CResult_ShutdownScriptDecodeErrorZ_ok(long o); // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ShutdownScriptDecodeErrorZ_err(long e); + // bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ShutdownScriptDecodeErrorZ_is_ok(long o); // void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res); public static native void CResult_ShutdownScriptDecodeErrorZ_free(long _res); + // uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ShutdownScriptDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ShutdownScriptDecodeErrorZ_clone(long orig); // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o); public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_ok(long o); // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e); public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_err(long e); + // bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o); + public static native boolean CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(long o); // void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res); public static native void CResult_ShutdownScriptInvalidShutdownScriptZ_free(long _res); + // uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg); + public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(long arg); // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig); public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_clone(long orig); // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void); public static native long CResult_NoneErrorZ_ok(); // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e); public static native long CResult_NoneErrorZ_err(IOError e); + // bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneErrorZ_is_ok(long o); // void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res); public static native void CResult_NoneErrorZ_free(long _res); + // uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneErrorZ_clone_ptr(long arg); // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig); public static native long CResult_NoneErrorZ_clone(long orig); // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o); public static native long CResult_RouteHopDecodeErrorZ_ok(long o); // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_RouteHopDecodeErrorZ_err(long e); + // bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RouteHopDecodeErrorZ_is_ok(long o); // void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res); public static native void CResult_RouteHopDecodeErrorZ_free(long _res); + // uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RouteHopDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RouteHopDecodeErrorZ_clone(long orig); // void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); @@ -1602,16 +1571,24 @@ public class bindings { public static native long CResult_RouteDecodeErrorZ_ok(long o); // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_RouteDecodeErrorZ_err(long e); + // bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RouteDecodeErrorZ_is_ok(long o); // void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); public static native void CResult_RouteDecodeErrorZ_free(long _res); + // uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RouteDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RouteDecodeErrorZ_clone(long orig); // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o); public static native long CResult_RouteParametersDecodeErrorZ_ok(long o); // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_RouteParametersDecodeErrorZ_err(long e); + // bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RouteParametersDecodeErrorZ_is_ok(long o); // void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res); public static native void CResult_RouteParametersDecodeErrorZ_free(long _res); + // uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RouteParametersDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RouteParametersDecodeErrorZ_clone(long orig); // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); @@ -1622,14 +1599,20 @@ public class bindings { public static native long COption_u64Z_none(); // void COption_u64Z_free(struct LDKCOption_u64Z _res); public static native void COption_u64Z_free(long _res); + // uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg); + public static native long COption_u64Z_clone_ptr(long arg); // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); public static native long COption_u64Z_clone(long orig); // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_ok(struct LDKPayee o); public static native long CResult_PayeeDecodeErrorZ_ok(long o); // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_PayeeDecodeErrorZ_err(long e); + // bool CResult_PayeeDecodeErrorZ_is_ok(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_PayeeDecodeErrorZ_is_ok(long o); // void CResult_PayeeDecodeErrorZ_free(struct LDKCResult_PayeeDecodeErrorZ _res); public static native void CResult_PayeeDecodeErrorZ_free(long _res); + // uint64_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_PayeeDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_clone(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_PayeeDecodeErrorZ_clone(long orig); // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); @@ -1638,16 +1621,24 @@ public class bindings { public static native long CResult_RouteHintDecodeErrorZ_ok(long o); // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_RouteHintDecodeErrorZ_err(long e); + // bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RouteHintDecodeErrorZ_is_ok(long o); // void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res); public static native void CResult_RouteHintDecodeErrorZ_free(long _res); + // uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RouteHintDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RouteHintDecodeErrorZ_clone(long orig); // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o); public static native long CResult_RouteHintHopDecodeErrorZ_ok(long o); // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_RouteHintHopDecodeErrorZ_err(long e); + // bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RouteHintHopDecodeErrorZ_is_ok(long o); // void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res); public static native void CResult_RouteHintHopDecodeErrorZ_free(long _res); + // uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RouteHintHopDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RouteHintHopDecodeErrorZ_clone(long orig); // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); @@ -1656,18 +1647,28 @@ public class bindings { public static native long CResult_RouteLightningErrorZ_ok(long o); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); public static native long CResult_RouteLightningErrorZ_err(long e); + // bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o); + public static native boolean CResult_RouteLightningErrorZ_is_ok(long o); // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); public static native void CResult_RouteLightningErrorZ_free(long _res); + // uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg); + public static native long CResult_RouteLightningErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); public static native long CResult_RouteLightningErrorZ_clone(long orig); // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); public static native long CResult_TxOutAccessErrorZ_ok(long o); // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); public static native long CResult_TxOutAccessErrorZ_err(AccessError e); + // bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o); + public static native boolean CResult_TxOutAccessErrorZ_is_ok(long o); // void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); public static native void CResult_TxOutAccessErrorZ_free(long _res); + // uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg); + public static native long CResult_TxOutAccessErrorZ_clone_ptr(long arg); // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); public static native long CResult_TxOutAccessErrorZ_clone(long orig); + // uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg); + public static native long C2Tuple_usizeTransactionZ_clone_ptr(long arg); // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig); public static native long C2Tuple_usizeTransactionZ_clone(long orig); // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); @@ -1682,8 +1683,12 @@ public class bindings { public static native long CResult_NoneChannelMonitorUpdateErrZ_ok(); // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e); public static native long CResult_NoneChannelMonitorUpdateErrZ_err(ChannelMonitorUpdateErr e); + // bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o); + public static native boolean CResult_NoneChannelMonitorUpdateErrZ_is_ok(long o); // void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res); public static native void CResult_NoneChannelMonitorUpdateErrZ_free(long _res); + // uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg); + public static native long CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(long arg); // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig); public static native long CResult_NoneChannelMonitorUpdateErrZ_clone(long orig); // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); @@ -1694,88 +1699,166 @@ public class bindings { public static native long COption_C2Tuple_usizeTransactionZZ_none(); // void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res); public static native void COption_C2Tuple_usizeTransactionZZ_free(long _res); + // uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_usizeTransactionZZ_clone_ptr(long arg); // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig); public static native long COption_C2Tuple_usizeTransactionZZ_clone(long orig); + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o); + public static native long COption_ClosureReasonZ_some(long o); + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void); + public static native long COption_ClosureReasonZ_none(); + // void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res); + public static native void COption_ClosureReasonZ_free(long _res); + // uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg); + public static native long COption_ClosureReasonZ_clone_ptr(long arg); + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig); + public static native long COption_ClosureReasonZ_clone(long orig); + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o); + public static native long CResult_COption_ClosureReasonZDecodeErrorZ_ok(long o); + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_COption_ClosureReasonZDecodeErrorZ_err(long e); + // bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(long o); + // void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res); + public static native void CResult_COption_ClosureReasonZDecodeErrorZ_free(long _res); + // uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_COption_ClosureReasonZDecodeErrorZ_clone(long orig); // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); public static native long COption_NetworkUpdateZ_some(long o); // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void); public static native long COption_NetworkUpdateZ_none(); // void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res); public static native void COption_NetworkUpdateZ_free(long _res); + // uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg); + public static native long COption_NetworkUpdateZ_clone_ptr(long arg); // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig); public static native long COption_NetworkUpdateZ_clone(long orig); // void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res); public static native void CVec_SpendableOutputDescriptorZ_free(long[] _res); + // struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o); + public static native long COption_EventZ_some(long o); + // struct LDKCOption_EventZ COption_EventZ_none(void); + public static native long COption_EventZ_none(); + // void COption_EventZ_free(struct LDKCOption_EventZ _res); + public static native void COption_EventZ_free(long _res); + // uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg); + public static native long COption_EventZ_clone_ptr(long arg); + // struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig); + public static native long COption_EventZ_clone(long orig); + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o); + public static native long CResult_COption_EventZDecodeErrorZ_ok(long o); + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_COption_EventZDecodeErrorZ_err(long e); + // bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_COption_EventZDecodeErrorZ_is_ok(long o); + // void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res); + public static native void CResult_COption_EventZDecodeErrorZ_free(long _res); + // uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_COption_EventZDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_COption_EventZDecodeErrorZ_clone(long orig); // void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); public static native void CVec_MessageSendEventZ_free(long[] _res); // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o); public static native long CResult_InitFeaturesDecodeErrorZ_ok(long o); // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_InitFeaturesDecodeErrorZ_err(long e); + // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_InitFeaturesDecodeErrorZ_is_ok(long o); // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res); public static native void CResult_InitFeaturesDecodeErrorZ_free(long _res); // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o); public static native long CResult_NodeFeaturesDecodeErrorZ_ok(long o); // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_NodeFeaturesDecodeErrorZ_err(long e); + // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeFeaturesDecodeErrorZ_is_ok(long o); // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res); public static native void CResult_NodeFeaturesDecodeErrorZ_free(long _res); // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o); public static native long CResult_ChannelFeaturesDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelFeaturesDecodeErrorZ_err(long e); + // bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelFeaturesDecodeErrorZ_is_ok(long o); // void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res); public static native void CResult_ChannelFeaturesDecodeErrorZ_free(long _res); // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o); public static native long CResult_InvoiceFeaturesDecodeErrorZ_ok(long o); // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_InvoiceFeaturesDecodeErrorZ_err(long e); + // bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceFeaturesDecodeErrorZ_is_ok(long o); // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res); public static native void CResult_InvoiceFeaturesDecodeErrorZ_free(long _res); // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o); public static native long CResult_ScoringParametersDecodeErrorZ_ok(long o); // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ScoringParametersDecodeErrorZ_err(long e); + // bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ScoringParametersDecodeErrorZ_is_ok(long o); // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res); public static native void CResult_ScoringParametersDecodeErrorZ_free(long _res); // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o); public static native long CResult_ScorerDecodeErrorZ_ok(long o); // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ScorerDecodeErrorZ_err(long e); + // bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ScorerDecodeErrorZ_is_ok(long o); // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res); public static native void CResult_ScorerDecodeErrorZ_free(long _res); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(long o); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(long e); + // bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(long o); // void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res); public static native void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(long _res); + // uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(long orig); // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o); public static native long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(long o); // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(long e); + // bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(long o); // void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res); public static native void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(long _res); + // uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(long orig); // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o); public static native long CResult_SpendableOutputDescriptorDecodeErrorZ_ok(long o); // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_SpendableOutputDescriptorDecodeErrorZ_err(long e); + // bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(long o); // void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res); public static native void CResult_SpendableOutputDescriptorDecodeErrorZ_free(long _res); + // uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_SpendableOutputDescriptorDecodeErrorZ_clone(long orig); // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); public static native long CResult_NoneNoneZ_ok(); // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); public static native long CResult_NoneNoneZ_err(); + // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); + public static native boolean CResult_NoneNoneZ_is_ok(long o); // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); public static native void CResult_NoneNoneZ_free(long _res); + // uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); + public static native long CResult_NoneNoneZ_clone_ptr(long arg); // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); public static native long CResult_NoneNoneZ_clone(long orig); + // uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg); + public static native long C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(long arg); // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig); public static native long C2Tuple_SignatureCVec_SignatureZZ_clone(long orig); // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b); @@ -1786,24 +1869,36 @@ public class bindings { public static native long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(long o); // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void); public static native long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); + // bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o); + public static native boolean CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(long o); // void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res); public static native void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(long _res); + // uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg); + public static native long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(long arg); // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig); public static native long CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(long orig); // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o); public static native long CResult_SignatureNoneZ_ok(byte[] o); // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void); public static native long CResult_SignatureNoneZ_err(); + // bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o); + public static native boolean CResult_SignatureNoneZ_is_ok(long o); // void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res); public static native void CResult_SignatureNoneZ_free(long _res); + // uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg); + public static native long CResult_SignatureNoneZ_clone_ptr(long arg); // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig); public static native long CResult_SignatureNoneZ_clone(long orig); // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o); public static native long CResult_SignDecodeErrorZ_ok(long o); // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_SignDecodeErrorZ_err(long e); + // bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_SignDecodeErrorZ_is_ok(long o); // void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res); public static native void CResult_SignDecodeErrorZ_free(long _res); + // uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_SignDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_SignDecodeErrorZ_clone(long orig); // void CVec_u8Z_free(struct LDKCVec_u8Z _res); @@ -1812,8 +1907,12 @@ public class bindings { public static native long CResult_RecoverableSignatureNoneZ_ok(byte[] arg); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void); public static native long CResult_RecoverableSignatureNoneZ_err(); + // bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o); + public static native boolean CResult_RecoverableSignatureNoneZ_is_ok(long o); // void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res); public static native void CResult_RecoverableSignatureNoneZ_free(long _res); + // uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg); + public static native long CResult_RecoverableSignatureNoneZ_clone_ptr(long arg); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig); public static native long CResult_RecoverableSignatureNoneZ_clone(long orig); // void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res); @@ -1822,16 +1921,24 @@ public class bindings { public static native long CResult_CVec_CVec_u8ZZNoneZ_ok(byte[][] o); // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void); public static native long CResult_CVec_CVec_u8ZZNoneZ_err(); + // bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o); + public static native boolean CResult_CVec_CVec_u8ZZNoneZ_is_ok(long o); // void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res); public static native void CResult_CVec_CVec_u8ZZNoneZ_free(long _res); + // uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg); + public static native long CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(long arg); // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig); public static native long CResult_CVec_CVec_u8ZZNoneZ_clone(long orig); // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o); public static native long CResult_InMemorySignerDecodeErrorZ_ok(long o); // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_InMemorySignerDecodeErrorZ_err(long e); + // bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_InMemorySignerDecodeErrorZ_is_ok(long o); // void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res); public static native void CResult_InMemorySignerDecodeErrorZ_free(long _res); + // uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_InMemorySignerDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_InMemorySignerDecodeErrorZ_clone(long orig); // void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res); @@ -1840,10 +1947,16 @@ public class bindings { public static native long CResult_TransactionNoneZ_ok(byte[] o); // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void); public static native long CResult_TransactionNoneZ_err(); + // bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o); + public static native boolean CResult_TransactionNoneZ_is_ok(long o); // void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res); public static native void CResult_TransactionNoneZ_free(long _res); + // uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg); + public static native long CResult_TransactionNoneZ_clone_ptr(long arg); // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig); public static native long CResult_TransactionNoneZ_clone(long orig); + // uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg); + public static native long C2Tuple_BlockHashChannelMonitorZ_clone_ptr(long arg); // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_clone(const struct LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR orig); public static native long C2Tuple_BlockHashChannelMonitorZ_clone(long orig); // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); @@ -1856,8 +1969,12 @@ public class bindings { public static native long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(long[] o); // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e); public static native long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(IOError e); + // bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o); + public static native boolean CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(long o); // void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res); public static native void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(long _res); + // uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg); + public static native long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(long arg); // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR orig); public static native long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(long orig); // struct LDKCOption_u16Z COption_u16Z_some(uint16_t o); @@ -1866,14 +1983,20 @@ public class bindings { public static native long COption_u16Z_none(); // void COption_u16Z_free(struct LDKCOption_u16Z _res); public static native void COption_u16Z_free(long _res); + // uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg); + public static native long COption_u16Z_clone_ptr(long arg); // struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig); public static native long COption_u16Z_clone(long orig); // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); public static native long CResult_NoneAPIErrorZ_ok(); // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); public static native long CResult_NoneAPIErrorZ_err(long e); + // bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneAPIErrorZ_is_ok(long o); // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); public static native void CResult_NoneAPIErrorZ_free(long _res); + // uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneAPIErrorZ_clone_ptr(long arg); // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); public static native long CResult_NoneAPIErrorZ_clone(long orig); // void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res); @@ -1884,26 +2007,40 @@ public class bindings { public static native long CResult__u832APIErrorZ_ok(byte[] o); // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e); public static native long CResult__u832APIErrorZ_err(long e); + // bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o); + public static native boolean CResult__u832APIErrorZ_is_ok(long o); // void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res); public static native void CResult__u832APIErrorZ_free(long _res); + // uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg); + public static native long CResult__u832APIErrorZ_clone_ptr(long arg); // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig); public static native long CResult__u832APIErrorZ_clone(long orig); // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o); public static native long CResult_PaymentIdPaymentSendFailureZ_ok(byte[] o); // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); public static native long CResult_PaymentIdPaymentSendFailureZ_err(long e); + // bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o); + public static native boolean CResult_PaymentIdPaymentSendFailureZ_is_ok(long o); // void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res); public static native void CResult_PaymentIdPaymentSendFailureZ_free(long _res); + // uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg); + public static native long CResult_PaymentIdPaymentSendFailureZ_clone_ptr(long arg); // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig); public static native long CResult_PaymentIdPaymentSendFailureZ_clone(long orig); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); public static native long CResult_NonePaymentSendFailureZ_ok(); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); public static native long CResult_NonePaymentSendFailureZ_err(long e); + // bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o); + public static native boolean CResult_NonePaymentSendFailureZ_is_ok(long o); // void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res); public static native void CResult_NonePaymentSendFailureZ_free(long _res); + // uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg); + public static native long CResult_NonePaymentSendFailureZ_clone_ptr(long arg); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig); public static native long CResult_NonePaymentSendFailureZ_clone(long orig); + // uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg); + public static native long C2Tuple_PaymentHashPaymentIdZ_clone_ptr(long arg); // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig); public static native long C2Tuple_PaymentHashPaymentIdZ_clone(long orig); // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); @@ -1914,12 +2051,18 @@ public class bindings { public static native long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(long o); // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); public static native long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(long e); + // bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o); + public static native boolean CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(long o); // void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res); public static native void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(long _res); + // uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg); + public static native long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(long arg); // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig); public static native long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(long orig); // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); public static native void CVec_NetAddressZ_free(long[] _res); + // uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg); + public static native long C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(long arg); // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig); public static native long C2Tuple_PaymentHashPaymentSecretZ_clone(long orig); // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); @@ -1930,8 +2073,12 @@ public class bindings { public static native long CResult_PaymentSecretAPIErrorZ_ok(byte[] o); // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e); public static native long CResult_PaymentSecretAPIErrorZ_err(long e); + // bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o); + public static native boolean CResult_PaymentSecretAPIErrorZ_is_ok(long o); // void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res); public static native void CResult_PaymentSecretAPIErrorZ_free(long _res); + // uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg); + public static native long CResult_PaymentSecretAPIErrorZ_clone_ptr(long arg); // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig); public static native long CResult_PaymentSecretAPIErrorZ_clone(long orig); // void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); @@ -1944,22 +2091,32 @@ public class bindings { public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(long o); // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(long e); + // bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(long o); // void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); public static native void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(long _res); // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o); public static native long CResult_ChannelConfigDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelConfigDecodeErrorZ_err(long e); + // bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelConfigDecodeErrorZ_is_ok(long o); // void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res); public static native void CResult_ChannelConfigDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelConfigDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelConfigDecodeErrorZ_clone(long orig); // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o); public static native long CResult_OutPointDecodeErrorZ_ok(long o); // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_OutPointDecodeErrorZ_err(long e); + // bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_OutPointDecodeErrorZ_is_ok(long o); // void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res); public static native void CResult_OutPointDecodeErrorZ_free(long _res); + // uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_OutPointDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_OutPointDecodeErrorZ_clone(long orig); // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); @@ -1968,48 +2125,72 @@ public class bindings { public static native long COption_TypeZ_none(); // void COption_TypeZ_free(struct LDKCOption_TypeZ _res); public static native void COption_TypeZ_free(long _res); + // uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg); + public static native long COption_TypeZ_clone_ptr(long arg); // struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig); public static native long COption_TypeZ_clone(long orig); // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o); public static native long CResult_COption_TypeZDecodeErrorZ_ok(long o); // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_COption_TypeZDecodeErrorZ_err(long e); + // bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_COption_TypeZDecodeErrorZ_is_ok(long o); // void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res); public static native void CResult_COption_TypeZDecodeErrorZ_free(long _res); + // uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_COption_TypeZDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_COption_TypeZDecodeErrorZ_clone(long orig); // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o); public static native long CResult_PaymentIdPaymentErrorZ_ok(byte[] o); // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e); public static native long CResult_PaymentIdPaymentErrorZ_err(long e); + // bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o); + public static native boolean CResult_PaymentIdPaymentErrorZ_is_ok(long o); // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res); public static native void CResult_PaymentIdPaymentErrorZ_free(long _res); + // uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg); + public static native long CResult_PaymentIdPaymentErrorZ_clone_ptr(long arg); // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig); public static native long CResult_PaymentIdPaymentErrorZ_clone(long orig); // struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o); public static native long CResult_SiPrefixNoneZ_ok(SiPrefix o); // struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void); public static native long CResult_SiPrefixNoneZ_err(); + // bool CResult_SiPrefixNoneZ_is_ok(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR o); + public static native boolean CResult_SiPrefixNoneZ_is_ok(long o); // void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res); public static native void CResult_SiPrefixNoneZ_free(long _res); + // uint64_t CResult_SiPrefixNoneZ_clone_ptr(LDKCResult_SiPrefixNoneZ *NONNULL_PTR arg); + public static native long CResult_SiPrefixNoneZ_clone_ptr(long arg); // struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig); public static native long CResult_SiPrefixNoneZ_clone(long orig); // struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o); public static native long CResult_InvoiceNoneZ_ok(long o); // struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void); public static native long CResult_InvoiceNoneZ_err(); + // bool CResult_InvoiceNoneZ_is_ok(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceNoneZ_is_ok(long o); // void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res); public static native void CResult_InvoiceNoneZ_free(long _res); + // uint64_t CResult_InvoiceNoneZ_clone_ptr(LDKCResult_InvoiceNoneZ *NONNULL_PTR arg); + public static native long CResult_InvoiceNoneZ_clone_ptr(long arg); // struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig); public static native long CResult_InvoiceNoneZ_clone(long orig); // struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o); public static native long CResult_SignedRawInvoiceNoneZ_ok(long o); // struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void); public static native long CResult_SignedRawInvoiceNoneZ_err(); + // bool CResult_SignedRawInvoiceNoneZ_is_ok(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR o); + public static native boolean CResult_SignedRawInvoiceNoneZ_is_ok(long o); // void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res); public static native void CResult_SignedRawInvoiceNoneZ_free(long _res); + // uint64_t CResult_SignedRawInvoiceNoneZ_clone_ptr(LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR arg); + public static native long CResult_SignedRawInvoiceNoneZ_clone_ptr(long arg); // struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig); public static native long CResult_SignedRawInvoiceNoneZ_clone(long orig); + // uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg); + public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(long arg); // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig); public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(long orig); // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c); @@ -2020,8 +2201,12 @@ public class bindings { public static native long CResult_PayeePubKeyErrorZ_ok(long o); // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e); public static native long CResult_PayeePubKeyErrorZ_err(Secp256k1Error e); + // bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o); + public static native boolean CResult_PayeePubKeyErrorZ_is_ok(long o); // void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res); public static native void CResult_PayeePubKeyErrorZ_free(long _res); + // uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg); + public static native long CResult_PayeePubKeyErrorZ_clone_ptr(long arg); // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig); public static native long CResult_PayeePubKeyErrorZ_clone(long orig); // void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res); @@ -2030,86 +2215,150 @@ public class bindings { public static native long CResult_PositiveTimestampCreationErrorZ_ok(long o); // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e); public static native long CResult_PositiveTimestampCreationErrorZ_err(CreationError e); + // bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_PositiveTimestampCreationErrorZ_is_ok(long o); // void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res); public static native void CResult_PositiveTimestampCreationErrorZ_free(long _res); + // uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_PositiveTimestampCreationErrorZ_clone_ptr(long arg); // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig); public static native long CResult_PositiveTimestampCreationErrorZ_clone(long orig); // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void); public static native long CResult_NoneSemanticErrorZ_ok(); // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e); public static native long CResult_NoneSemanticErrorZ_err(SemanticError e); + // bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneSemanticErrorZ_is_ok(long o); // void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res); public static native void CResult_NoneSemanticErrorZ_free(long _res); + // uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneSemanticErrorZ_clone_ptr(long arg); // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig); public static native long CResult_NoneSemanticErrorZ_clone(long orig); // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o); public static native long CResult_InvoiceSemanticErrorZ_ok(long o); // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e); public static native long CResult_InvoiceSemanticErrorZ_err(SemanticError e); + // bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceSemanticErrorZ_is_ok(long o); // void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res); public static native void CResult_InvoiceSemanticErrorZ_free(long _res); + // uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg); + public static native long CResult_InvoiceSemanticErrorZ_clone_ptr(long arg); // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig); public static native long CResult_InvoiceSemanticErrorZ_clone(long orig); // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o); public static native long CResult_DescriptionCreationErrorZ_ok(long o); // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e); public static native long CResult_DescriptionCreationErrorZ_err(CreationError e); + // bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_DescriptionCreationErrorZ_is_ok(long o); // void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res); public static native void CResult_DescriptionCreationErrorZ_free(long _res); + // uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_DescriptionCreationErrorZ_clone_ptr(long arg); // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig); public static native long CResult_DescriptionCreationErrorZ_clone(long orig); // struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o); public static native long CResult_ExpiryTimeCreationErrorZ_ok(long o); // struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e); public static native long CResult_ExpiryTimeCreationErrorZ_err(CreationError e); + // bool CResult_ExpiryTimeCreationErrorZ_is_ok(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_ExpiryTimeCreationErrorZ_is_ok(long o); // void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res); public static native void CResult_ExpiryTimeCreationErrorZ_free(long _res); + // uint64_t CResult_ExpiryTimeCreationErrorZ_clone_ptr(LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_ExpiryTimeCreationErrorZ_clone_ptr(long arg); // struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig); public static native long CResult_ExpiryTimeCreationErrorZ_clone(long orig); // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o); public static native long CResult_PrivateRouteCreationErrorZ_ok(long o); // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e); public static native long CResult_PrivateRouteCreationErrorZ_err(CreationError e); + // bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_PrivateRouteCreationErrorZ_is_ok(long o); // void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res); public static native void CResult_PrivateRouteCreationErrorZ_free(long _res); + // uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_PrivateRouteCreationErrorZ_clone_ptr(long arg); // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig); public static native long CResult_PrivateRouteCreationErrorZ_clone(long orig); // struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o); public static native long CResult_StringErrorZ_ok(String o); // struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e); public static native long CResult_StringErrorZ_err(Secp256k1Error e); + // bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o); + public static native boolean CResult_StringErrorZ_is_ok(long o); // void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res); public static native void CResult_StringErrorZ_free(long _res); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); public static native long CResult_ChannelMonitorUpdateDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelMonitorUpdateDecodeErrorZ_err(long e); + // bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(long o); // void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res); public static native void CResult_ChannelMonitorUpdateDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelMonitorUpdateDecodeErrorZ_clone(long orig); + // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o); + public static native long COption_MonitorEventZ_some(long o); + // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void); + public static native long COption_MonitorEventZ_none(); + // void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res); + public static native void COption_MonitorEventZ_free(long _res); + // uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg); + public static native long COption_MonitorEventZ_clone_ptr(long arg); + // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig); + public static native long COption_MonitorEventZ_clone(long orig); + // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o); + public static native long CResult_COption_MonitorEventZDecodeErrorZ_ok(long o); + // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_COption_MonitorEventZDecodeErrorZ_err(long e); + // bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_COption_MonitorEventZDecodeErrorZ_is_ok(long o); + // void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res); + public static native void CResult_COption_MonitorEventZDecodeErrorZ_free(long _res); + // uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_COption_MonitorEventZDecodeErrorZ_clone(long orig); // struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o); public static native long CResult_HTLCUpdateDecodeErrorZ_ok(long o); // struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_HTLCUpdateDecodeErrorZ_err(long e); + // bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_HTLCUpdateDecodeErrorZ_is_ok(long o); // void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res); public static native void CResult_HTLCUpdateDecodeErrorZ_free(long _res); + // uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_HTLCUpdateDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_HTLCUpdateDecodeErrorZ_clone(long orig); // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void); public static native long CResult_NoneMonitorUpdateErrorZ_ok(); // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e); public static native long CResult_NoneMonitorUpdateErrorZ_err(long e); + // bool CResult_NoneMonitorUpdateErrorZ_is_ok(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneMonitorUpdateErrorZ_is_ok(long o); // void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res); public static native void CResult_NoneMonitorUpdateErrorZ_free(long _res); + // uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneMonitorUpdateErrorZ_clone_ptr(long arg); // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig); public static native long CResult_NoneMonitorUpdateErrorZ_clone(long orig); + // uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg); + public static native long C2Tuple_OutPointScriptZ_clone_ptr(long arg); // struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig); public static native long C2Tuple_OutPointScriptZ_clone(long orig); // struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b); public static native long C2Tuple_OutPointScriptZ_new(long a, byte[] b); // void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res); public static native void C2Tuple_OutPointScriptZ_free(long _res); + // uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg); + public static native long C2Tuple_u32ScriptZ_clone_ptr(long arg); // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig); public static native long C2Tuple_u32ScriptZ_clone(long orig); // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b); @@ -2118,6 +2367,8 @@ public class bindings { public static native void C2Tuple_u32ScriptZ_free(long _res); // void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res); public static native void CVec_C2Tuple_u32ScriptZZ_free(long[] _res); + // uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg); + public static native long C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(long arg); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig); public static native long C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(long orig); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b); @@ -2130,6 +2381,8 @@ public class bindings { public static native void CVec_EventZ_free(long[] _res); // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); public static native void CVec_TransactionZ_free(byte[][] _res); + // uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg); + public static native long C2Tuple_u32TxOutZ_clone_ptr(long arg); // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig); public static native long C2Tuple_u32TxOutZ_clone(long orig); // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b); @@ -2138,6 +2391,8 @@ public class bindings { public static native void C2Tuple_u32TxOutZ_free(long _res); // void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res); public static native void CVec_C2Tuple_u32TxOutZZ_free(long[] _res); + // uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg); + public static native long C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(long arg); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig); public static native long C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(long orig); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b); @@ -2152,18 +2407,28 @@ public class bindings { public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(long o); // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(long e); + // bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(long o); // void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res); public static native void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(long _res); + // uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(long orig); // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); public static native long CResult_NoneLightningErrorZ_ok(); // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); public static native long CResult_NoneLightningErrorZ_err(long e); + // bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneLightningErrorZ_is_ok(long o); // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); public static native void CResult_NoneLightningErrorZ_free(long _res); + // uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneLightningErrorZ_clone_ptr(long arg); // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); public static native long CResult_NoneLightningErrorZ_clone(long orig); + // uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg); + public static native long C2Tuple_PublicKeyTypeZ_clone_ptr(long arg); // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig); public static native long C2Tuple_PublicKeyTypeZ_clone(long orig); // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b); @@ -2176,10 +2441,16 @@ public class bindings { public static native long CResult_boolLightningErrorZ_ok(boolean o); // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); public static native long CResult_boolLightningErrorZ_err(long e); + // bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o); + public static native boolean CResult_boolLightningErrorZ_is_ok(long o); // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); public static native void CResult_boolLightningErrorZ_free(long _res); + // uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg); + public static native long CResult_boolLightningErrorZ_clone_ptr(long arg); // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); public static native long CResult_boolLightningErrorZ_clone(long orig); + // uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg); + public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(long arg); // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(long orig); // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); @@ -2196,34 +2467,62 @@ public class bindings { public static native long CResult_CVec_u8ZPeerHandleErrorZ_ok(byte[] o); // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e); public static native long CResult_CVec_u8ZPeerHandleErrorZ_err(long e); + // bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o); + public static native boolean CResult_CVec_u8ZPeerHandleErrorZ_is_ok(long o); // void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res); public static native void CResult_CVec_u8ZPeerHandleErrorZ_free(long _res); + // uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg); + public static native long CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(long arg); // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig); public static native long CResult_CVec_u8ZPeerHandleErrorZ_clone(long orig); // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void); public static native long CResult_NonePeerHandleErrorZ_ok(); // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e); public static native long CResult_NonePeerHandleErrorZ_err(long e); + // bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o); + public static native boolean CResult_NonePeerHandleErrorZ_is_ok(long o); // void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res); public static native void CResult_NonePeerHandleErrorZ_free(long _res); + // uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg); + public static native long CResult_NonePeerHandleErrorZ_clone_ptr(long arg); // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig); public static native long CResult_NonePeerHandleErrorZ_clone(long orig); // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o); public static native long CResult_boolPeerHandleErrorZ_ok(boolean o); // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e); public static native long CResult_boolPeerHandleErrorZ_err(long e); + // bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o); + public static native boolean CResult_boolPeerHandleErrorZ_is_ok(long o); // void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res); public static native void CResult_boolPeerHandleErrorZ_free(long _res); + // uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg); + public static native long CResult_boolPeerHandleErrorZ_clone_ptr(long arg); // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); public static native long CResult_boolPeerHandleErrorZ_clone(long orig); // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o); public static native long CResult_NodeIdDecodeErrorZ_ok(long o); // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_NodeIdDecodeErrorZ_err(long e); + // bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeIdDecodeErrorZ_is_ok(long o); // void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res); public static native void CResult_NodeIdDecodeErrorZ_free(long _res); + // uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NodeIdDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_NodeIdDecodeErrorZ_clone(long orig); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_ok(long o); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_err(long e); + // bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(long o); + // void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res); + public static native void CResult_COption_NetworkUpdateZDecodeErrorZ_free(long _res); + // uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_clone(long orig); // struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o); public static native long COption_AccessZ_some(long o); // struct LDKCOption_AccessZ COption_AccessZ_none(void); @@ -2234,32 +2533,48 @@ public class bindings { public static native long CResult_DirectionalChannelInfoDecodeErrorZ_ok(long o); // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_DirectionalChannelInfoDecodeErrorZ_err(long e); + // bool CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(long o); // void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res); public static native void CResult_DirectionalChannelInfoDecodeErrorZ_free(long _res); + // uint64_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_DirectionalChannelInfoDecodeErrorZ_clone(long orig); // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o); public static native long CResult_ChannelInfoDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelInfoDecodeErrorZ_err(long e); + // bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelInfoDecodeErrorZ_is_ok(long o); // void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res); public static native void CResult_ChannelInfoDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelInfoDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelInfoDecodeErrorZ_clone(long orig); // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); public static native long CResult_RoutingFeesDecodeErrorZ_ok(long o); // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_RoutingFeesDecodeErrorZ_err(long e); + // bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RoutingFeesDecodeErrorZ_is_ok(long o); // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); public static native void CResult_RoutingFeesDecodeErrorZ_free(long _res); + // uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RoutingFeesDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RoutingFeesDecodeErrorZ_clone(long orig); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_ok(long o); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_err(long e); + // bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(long o); // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); public static native void CResult_NodeAnnouncementInfoDecodeErrorZ_free(long _res); + // uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_clone(long orig); // void CVec_u64Z_free(struct LDKCVec_u64Z _res); @@ -2268,16 +2583,24 @@ public class bindings { public static native long CResult_NodeInfoDecodeErrorZ_ok(long o); // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_NodeInfoDecodeErrorZ_err(long e); + // bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeInfoDecodeErrorZ_is_ok(long o); // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); public static native void CResult_NodeInfoDecodeErrorZ_free(long _res); + // uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NodeInfoDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_NodeInfoDecodeErrorZ_clone(long orig); // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); public static native long CResult_NetworkGraphDecodeErrorZ_ok(long o); // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_NetworkGraphDecodeErrorZ_err(long e); + // bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NetworkGraphDecodeErrorZ_is_ok(long o); // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); public static native void CResult_NetworkGraphDecodeErrorZ_free(long _res); + // uint64_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NetworkGraphDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_NetworkGraphDecodeErrorZ_clone(long orig); // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o); @@ -2286,14 +2609,20 @@ public class bindings { public static native long COption_CVec_NetAddressZZ_none(); // void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res); public static native void COption_CVec_NetAddressZZ_free(long _res); + // uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg); + public static native long COption_CVec_NetAddressZZ_clone_ptr(long arg); // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig); public static native long COption_CVec_NetAddressZZ_clone(long orig); // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o); public static native long CResult_NetAddressDecodeErrorZ_ok(long o); // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_NetAddressDecodeErrorZ_err(long e); + // bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NetAddressDecodeErrorZ_is_ok(long o); // void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res); public static native void CResult_NetAddressDecodeErrorZ_free(long _res); + // uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NetAddressDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_NetAddressDecodeErrorZ_clone(long orig); // void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res); @@ -2308,264 +2637,396 @@ public class bindings { public static native long CResult_AcceptChannelDecodeErrorZ_ok(long o); // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_AcceptChannelDecodeErrorZ_err(long e); + // bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_AcceptChannelDecodeErrorZ_is_ok(long o); // void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res); public static native void CResult_AcceptChannelDecodeErrorZ_free(long _res); + // uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_AcceptChannelDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_AcceptChannelDecodeErrorZ_clone(long orig); // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o); public static native long CResult_AnnouncementSignaturesDecodeErrorZ_ok(long o); // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_AnnouncementSignaturesDecodeErrorZ_err(long e); + // bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(long o); // void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res); public static native void CResult_AnnouncementSignaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_AnnouncementSignaturesDecodeErrorZ_clone(long orig); // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o); public static native long CResult_ChannelReestablishDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelReestablishDecodeErrorZ_err(long e); + // bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelReestablishDecodeErrorZ_is_ok(long o); // void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res); public static native void CResult_ChannelReestablishDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelReestablishDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelReestablishDecodeErrorZ_clone(long orig); // struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o); public static native long CResult_ClosingSignedDecodeErrorZ_ok(long o); // struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ClosingSignedDecodeErrorZ_err(long e); + // bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ClosingSignedDecodeErrorZ_is_ok(long o); // void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res); public static native void CResult_ClosingSignedDecodeErrorZ_free(long _res); + // uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ClosingSignedDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ClosingSignedDecodeErrorZ_clone(long orig); // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o); public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(long o); // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_err(long e); + // bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(long o); // void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res); public static native void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(long _res); + // uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(long orig); // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o); public static native long CResult_CommitmentSignedDecodeErrorZ_ok(long o); // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_CommitmentSignedDecodeErrorZ_err(long e); + // bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_CommitmentSignedDecodeErrorZ_is_ok(long o); // void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res); public static native void CResult_CommitmentSignedDecodeErrorZ_free(long _res); + // uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_CommitmentSignedDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_CommitmentSignedDecodeErrorZ_clone(long orig); // struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o); public static native long CResult_FundingCreatedDecodeErrorZ_ok(long o); // struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_FundingCreatedDecodeErrorZ_err(long e); + // bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_FundingCreatedDecodeErrorZ_is_ok(long o); // void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res); public static native void CResult_FundingCreatedDecodeErrorZ_free(long _res); + // uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_FundingCreatedDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_FundingCreatedDecodeErrorZ_clone(long orig); // struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o); public static native long CResult_FundingSignedDecodeErrorZ_ok(long o); // struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_FundingSignedDecodeErrorZ_err(long e); + // bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_FundingSignedDecodeErrorZ_is_ok(long o); // void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res); public static native void CResult_FundingSignedDecodeErrorZ_free(long _res); + // uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_FundingSignedDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_FundingSignedDecodeErrorZ_clone(long orig); // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o); public static native long CResult_FundingLockedDecodeErrorZ_ok(long o); // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_FundingLockedDecodeErrorZ_err(long e); + // bool CResult_FundingLockedDecodeErrorZ_is_ok(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_FundingLockedDecodeErrorZ_is_ok(long o); // void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res); public static native void CResult_FundingLockedDecodeErrorZ_free(long _res); + // uint64_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_FundingLockedDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_FundingLockedDecodeErrorZ_clone(long orig); // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o); public static native long CResult_InitDecodeErrorZ_ok(long o); // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_InitDecodeErrorZ_err(long e); + // bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_InitDecodeErrorZ_is_ok(long o); // void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res); public static native void CResult_InitDecodeErrorZ_free(long _res); + // uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_InitDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_InitDecodeErrorZ_clone(long orig); // struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o); public static native long CResult_OpenChannelDecodeErrorZ_ok(long o); // struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_OpenChannelDecodeErrorZ_err(long e); + // bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_OpenChannelDecodeErrorZ_is_ok(long o); // void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res); public static native void CResult_OpenChannelDecodeErrorZ_free(long _res); + // uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_OpenChannelDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_OpenChannelDecodeErrorZ_clone(long orig); // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o); public static native long CResult_RevokeAndACKDecodeErrorZ_ok(long o); // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_RevokeAndACKDecodeErrorZ_err(long e); + // bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RevokeAndACKDecodeErrorZ_is_ok(long o); // void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res); public static native void CResult_RevokeAndACKDecodeErrorZ_free(long _res); + // uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RevokeAndACKDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RevokeAndACKDecodeErrorZ_clone(long orig); // struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o); public static native long CResult_ShutdownDecodeErrorZ_ok(long o); // struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ShutdownDecodeErrorZ_err(long e); + // bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ShutdownDecodeErrorZ_is_ok(long o); // void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res); public static native void CResult_ShutdownDecodeErrorZ_free(long _res); + // uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ShutdownDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ShutdownDecodeErrorZ_clone(long orig); // struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o); public static native long CResult_UpdateFailHTLCDecodeErrorZ_ok(long o); // struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_UpdateFailHTLCDecodeErrorZ_err(long e); + // bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UpdateFailHTLCDecodeErrorZ_is_ok(long o); // void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res); public static native void CResult_UpdateFailHTLCDecodeErrorZ_free(long _res); + // uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_UpdateFailHTLCDecodeErrorZ_clone(long orig); // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o); public static native long CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(long o); // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(long e); + // bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(long o); // void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res); public static native void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(long _res); + // uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(long orig); // struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o); public static native long CResult_UpdateFeeDecodeErrorZ_ok(long o); // struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_UpdateFeeDecodeErrorZ_err(long e); + // bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UpdateFeeDecodeErrorZ_is_ok(long o); // void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res); public static native void CResult_UpdateFeeDecodeErrorZ_free(long _res); + // uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UpdateFeeDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_UpdateFeeDecodeErrorZ_clone(long orig); // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o); public static native long CResult_UpdateFulfillHTLCDecodeErrorZ_ok(long o); // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_UpdateFulfillHTLCDecodeErrorZ_err(long e); + // bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(long o); // void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res); public static native void CResult_UpdateFulfillHTLCDecodeErrorZ_free(long _res); + // uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_UpdateFulfillHTLCDecodeErrorZ_clone(long orig); // struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o); public static native long CResult_UpdateAddHTLCDecodeErrorZ_ok(long o); // struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_UpdateAddHTLCDecodeErrorZ_err(long e); + // bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UpdateAddHTLCDecodeErrorZ_is_ok(long o); // void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res); public static native void CResult_UpdateAddHTLCDecodeErrorZ_free(long _res); + // uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_UpdateAddHTLCDecodeErrorZ_clone(long orig); // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o); public static native long CResult_PingDecodeErrorZ_ok(long o); // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_PingDecodeErrorZ_err(long e); + // bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_PingDecodeErrorZ_is_ok(long o); // void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res); public static native void CResult_PingDecodeErrorZ_free(long _res); + // uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_PingDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_PingDecodeErrorZ_clone(long orig); // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o); public static native long CResult_PongDecodeErrorZ_ok(long o); // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_PongDecodeErrorZ_err(long e); + // bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_PongDecodeErrorZ_is_ok(long o); // void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res); public static native void CResult_PongDecodeErrorZ_free(long _res); + // uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_PongDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_PongDecodeErrorZ_clone(long orig); // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o); public static native long CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(long o); // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(long e); + // bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(long o); // void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res); public static native void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(long _res); + // uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(long orig); // struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o); public static native long CResult_ChannelAnnouncementDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelAnnouncementDecodeErrorZ_err(long e); + // bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelAnnouncementDecodeErrorZ_is_ok(long o); // void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res); public static native void CResult_ChannelAnnouncementDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelAnnouncementDecodeErrorZ_clone(long orig); // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o); public static native long CResult_UnsignedChannelUpdateDecodeErrorZ_ok(long o); // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_UnsignedChannelUpdateDecodeErrorZ_err(long e); + // bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(long o); // void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res); public static native void CResult_UnsignedChannelUpdateDecodeErrorZ_free(long _res); + // uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_UnsignedChannelUpdateDecodeErrorZ_clone(long orig); // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o); public static native long CResult_ChannelUpdateDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ChannelUpdateDecodeErrorZ_err(long e); + // bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelUpdateDecodeErrorZ_is_ok(long o); // void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res); public static native void CResult_ChannelUpdateDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelUpdateDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelUpdateDecodeErrorZ_clone(long orig); // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o); public static native long CResult_ErrorMessageDecodeErrorZ_ok(long o); // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ErrorMessageDecodeErrorZ_err(long e); + // bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ErrorMessageDecodeErrorZ_is_ok(long o); // void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); public static native void CResult_ErrorMessageDecodeErrorZ_free(long _res); + // uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ErrorMessageDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ErrorMessageDecodeErrorZ_clone(long orig); // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o); public static native long CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(long o); // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(long e); + // bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(long o); // void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); public static native void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(long _res); + // uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(long orig); // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o); public static native long CResult_NodeAnnouncementDecodeErrorZ_ok(long o); // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_NodeAnnouncementDecodeErrorZ_err(long e); + // bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeAnnouncementDecodeErrorZ_is_ok(long o); // void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res); public static native void CResult_NodeAnnouncementDecodeErrorZ_free(long _res); + // uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_NodeAnnouncementDecodeErrorZ_clone(long orig); // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o); public static native long CResult_QueryShortChannelIdsDecodeErrorZ_ok(long o); // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_QueryShortChannelIdsDecodeErrorZ_err(long e); + // bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(long o); // void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); public static native void CResult_QueryShortChannelIdsDecodeErrorZ_free(long _res); + // uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_QueryShortChannelIdsDecodeErrorZ_clone(long orig); // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o); public static native long CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(long o); // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(long e); + // bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(long o); // void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); public static native void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(long _res); + // uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(long orig); // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o); public static native long CResult_QueryChannelRangeDecodeErrorZ_ok(long o); // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_QueryChannelRangeDecodeErrorZ_err(long e); + // bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_QueryChannelRangeDecodeErrorZ_is_ok(long o); // void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); public static native void CResult_QueryChannelRangeDecodeErrorZ_free(long _res); + // uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_QueryChannelRangeDecodeErrorZ_clone(long orig); // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o); public static native long CResult_ReplyChannelRangeDecodeErrorZ_ok(long o); // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_ReplyChannelRangeDecodeErrorZ_err(long e); + // bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ReplyChannelRangeDecodeErrorZ_is_ok(long o); // void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); public static native void CResult_ReplyChannelRangeDecodeErrorZ_free(long _res); + // uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ReplyChannelRangeDecodeErrorZ_clone(long orig); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o); public static native long CResult_GossipTimestampFilterDecodeErrorZ_ok(long o); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e); public static native long CResult_GossipTimestampFilterDecodeErrorZ_err(long e); + // bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_GossipTimestampFilterDecodeErrorZ_is_ok(long o); // void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); public static native void CResult_GossipTimestampFilterDecodeErrorZ_free(long _res); + // uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_GossipTimestampFilterDecodeErrorZ_clone(long orig); // struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o); public static native long CResult_InvoiceSignOrCreationErrorZ_ok(long o); // struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e); public static native long CResult_InvoiceSignOrCreationErrorZ_err(long e); + // bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceSignOrCreationErrorZ_is_ok(long o); // void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res); public static native void CResult_InvoiceSignOrCreationErrorZ_free(long _res); + // uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_InvoiceSignOrCreationErrorZ_clone_ptr(long arg); // struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig); public static native long CResult_InvoiceSignOrCreationErrorZ_clone(long orig); // struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o); @@ -2578,12 +3039,16 @@ public class bindings { public static native long CResult_LockedChannelMonitorNoneZ_ok(long o); // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void); public static native long CResult_LockedChannelMonitorNoneZ_err(); + // bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o); + public static native boolean CResult_LockedChannelMonitorNoneZ_is_ok(long o); // void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res); public static native void CResult_LockedChannelMonitorNoneZ_free(long _res); // void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res); public static native void CVec_OutPointZ_free(long[] _res); // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); public static native void PaymentPurpose_free(long this_ptr); + // uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg); + public static native long PaymentPurpose_clone_ptr(long arg); // struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig); public static native long PaymentPurpose_clone(long orig); // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t user_payment_id); @@ -2592,6 +3057,8 @@ public class bindings { public static native long PaymentPurpose_spontaneous_payment(byte[] a); // void ClosureReason_free(struct LDKClosureReason this_ptr); public static native void ClosureReason_free(long this_ptr); + // uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg); + public static native long ClosureReason_clone_ptr(long arg); // struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig); public static native long ClosureReason_clone(long orig); // struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg); @@ -2610,8 +3077,12 @@ public class bindings { public static native long ClosureReason_outdated_channel_manager(); // struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj); public static native byte[] ClosureReason_write(long obj); + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser); + public static native long ClosureReason_read(byte[] ser); // void Event_free(struct LDKEvent this_ptr); public static native void Event_free(long this_ptr); + // uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg); + public static native long Event_clone_ptr(long arg); // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); public static native long Event_clone(long orig); // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id); @@ -2634,8 +3105,12 @@ public class bindings { public static native long Event_discard_funding(byte[] channel_id, byte[] transaction); // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); public static native byte[] Event_write(long obj); + // struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser); + public static native long Event_read(byte[] ser); // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); public static native void MessageSendEvent_free(long this_ptr); + // uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg); + public static native long MessageSendEvent_clone_ptr(long arg); // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); public static native long MessageSendEvent_clone(long orig); // struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg); @@ -2684,6 +3159,8 @@ public class bindings { public static native void EventHandler_free(long this_ptr); // void APIError_free(struct LDKAPIError this_ptr); public static native void APIError_free(long this_ptr); + // uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg); + public static native long APIError_clone_ptr(long arg); // struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig); public static native long APIError_clone(long orig); // struct LDKAPIError APIError_apimisuse_error(struct LDKStr err); @@ -2722,6 +3199,32 @@ public class bindings { public static native long Level_hash(long o); // MUST_USE_RES enum LDKLevel Level_max(void); public static native Level Level_max(); + // void Record_free(struct LDKRecord this_obj); + public static native void Record_free(long this_obj); + // enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr); + public static native Level Record_get_level(long this_ptr); + // void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val); + public static native void Record_set_level(long this_ptr, Level val); + // struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr); + public static native String Record_get_args(long this_ptr); + // void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); + public static native void Record_set_args(long this_ptr, String val); + // struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr); + public static native String Record_get_module_path(long this_ptr); + // void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); + public static native void Record_set_module_path(long this_ptr, String val); + // struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr); + public static native String Record_get_file(long this_ptr); + // void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); + public static native void Record_set_file(long this_ptr, String val); + // uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr); + public static native int Record_get_line(long this_ptr); + // void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val); + public static native void Record_set_line(long this_ptr, int val); + // uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg); + public static native long Record_clone_ptr(long arg); + // struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig); + public static native long Record_clone(long orig); // void Logger_free(struct LDKLogger this_ptr); public static native void Logger_free(long this_ptr); // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj); @@ -2740,6 +3243,8 @@ public class bindings { public static native void ChannelHandshakeConfig_set_our_htlc_minimum_msat(long this_ptr, long val); // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg); public static native long ChannelHandshakeConfig_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg); + // uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg); + public static native long ChannelHandshakeConfig_clone_ptr(long arg); // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); public static native long ChannelHandshakeConfig_clone(long orig); // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); @@ -2780,6 +3285,8 @@ public class bindings { public static native void ChannelHandshakeLimits_set_their_to_self_delay(long this_ptr, short val); // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg); public static native long ChannelHandshakeLimits_new(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg); + // uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg); + public static native long ChannelHandshakeLimits_clone_ptr(long arg); // struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig); public static native long ChannelHandshakeLimits_clone(long orig); // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void); @@ -2816,6 +3323,8 @@ public class bindings { public static native void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(long this_ptr, long val); // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg); public static native long ChannelConfig_new(int forwarding_fee_proportional_millionths_arg, int forwarding_fee_base_msat_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg, long max_dust_htlc_exposure_msat_arg, long force_close_avoidance_max_fee_satoshis_arg); + // uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg); + public static native long ChannelConfig_clone_ptr(long arg); // struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); public static native long ChannelConfig_clone(long orig); // MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void); @@ -2844,12 +3353,16 @@ public class bindings { public static native void UserConfig_set_accept_forwards_to_priv_channels(long this_ptr, boolean val); // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg); public static native long UserConfig_new(long own_channel_config_arg, long peer_channel_config_limits_arg, long channel_options_arg, boolean accept_forwards_to_priv_channels_arg); + // uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg); + public static native long UserConfig_clone_ptr(long arg); // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); public static native long UserConfig_clone(long orig); // MUST_USE_RES struct LDKUserConfig UserConfig_default(void); public static native long UserConfig_default(); // void BestBlock_free(struct LDKBestBlock this_obj); public static native void BestBlock_free(long this_obj); + // uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg); + public static native long BestBlock_clone_ptr(long arg); // struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig); public static native long BestBlock_clone(long orig); // MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network); @@ -2898,6 +3411,8 @@ public class bindings { public static native void WatchedOutput_set_script_pubkey(long this_ptr, byte[] val); // MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg); public static native long WatchedOutput_new(byte[] block_hash_arg, long outpoint_arg, byte[] script_pubkey_arg); + // uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg); + public static native long WatchedOutput_clone_ptr(long arg); // struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig); public static native long WatchedOutput_clone(long orig); // uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o); @@ -2918,6 +3433,8 @@ public class bindings { public static native void FeeEstimator_free(long this_ptr); // void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj); public static native void MonitorUpdateId_free(long this_obj); + // uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg); + public static native long MonitorUpdateId_clone_ptr(long arg); // struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig); public static native long MonitorUpdateId_clone(long orig); // uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o); @@ -2954,6 +3471,8 @@ public class bindings { public static native long ChannelMonitorUpdate_get_update_id(long this_ptr); // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelMonitorUpdate_set_update_id(long this_ptr, long val); + // uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg); + public static native long ChannelMonitorUpdate_clone_ptr(long arg); // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); public static native long ChannelMonitorUpdate_clone(long orig); // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); @@ -2968,10 +3487,14 @@ public class bindings { public static native void MonitorUpdateError_set_a(long this_ptr, String val); // MUST_USE_RES struct LDKMonitorUpdateError MonitorUpdateError_new(struct LDKStr a_arg); public static native long MonitorUpdateError_new(String a_arg); + // uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg); + public static native long MonitorUpdateError_clone_ptr(long arg); // struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig); public static native long MonitorUpdateError_clone(long orig); // void MonitorEvent_free(struct LDKMonitorEvent this_ptr); public static native void MonitorEvent_free(long this_ptr); + // uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg); + public static native long MonitorEvent_clone_ptr(long arg); // struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig); public static native long MonitorEvent_clone(long orig); // struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a); @@ -2984,8 +3507,12 @@ public class bindings { public static native long MonitorEvent_update_failed(long a); // struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj); public static native byte[] MonitorEvent_write(long obj); + // struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser); + public static native long MonitorEvent_read(byte[] ser); // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj); public static native void HTLCUpdate_free(long this_obj); + // uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg); + public static native long HTLCUpdate_clone_ptr(long arg); // struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig); public static native long HTLCUpdate_clone(long orig); // struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj); @@ -2994,6 +3521,8 @@ public class bindings { public static native long HTLCUpdate_read(byte[] ser); // void Balance_free(struct LDKBalance this_ptr); public static native void Balance_free(long this_ptr); + // uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg); + public static native long Balance_clone_ptr(long arg); // struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig); public static native long Balance_clone(long orig); // struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis); @@ -3008,6 +3537,8 @@ public class bindings { public static native boolean Balance_eq(long a, long b); // void ChannelMonitor_free(struct LDKChannelMonitor this_obj); public static native void ChannelMonitor_free(long this_obj); + // uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg); + public static native long ChannelMonitor_clone_ptr(long arg); // struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig); public static native long ChannelMonitor_clone(long orig); // struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj); @@ -3058,6 +3589,8 @@ public class bindings { public static native void OutPoint_set_index(long this_ptr, short val); // MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg); public static native long OutPoint_new(byte[] txid_arg, short index_arg); + // uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg); + public static native long OutPoint_clone_ptr(long arg); // struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig); public static native long OutPoint_clone(long orig); // bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b); @@ -3100,6 +3633,8 @@ public class bindings { public static native void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(long this_ptr, long val); // MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); public static native long DelayedPaymentOutputDescriptor_new(long outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, long output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg); + // uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg); + public static native long DelayedPaymentOutputDescriptor_clone_ptr(long arg); // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig); public static native long DelayedPaymentOutputDescriptor_clone(long orig); // struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj); @@ -3124,6 +3659,8 @@ public class bindings { public static native void StaticPaymentOutputDescriptor_set_channel_value_satoshis(long this_ptr, long val); // MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); public static native long StaticPaymentOutputDescriptor_new(long outpoint_arg, long output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg); + // uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg); + public static native long StaticPaymentOutputDescriptor_clone_ptr(long arg); // struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig); public static native long StaticPaymentOutputDescriptor_clone(long orig); // struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj); @@ -3132,6 +3669,8 @@ public class bindings { public static native long StaticPaymentOutputDescriptor_read(byte[] ser); // void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr); public static native void SpendableOutputDescriptor_free(long this_ptr); + // uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg); + public static native long SpendableOutputDescriptor_clone_ptr(long arg); // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig); public static native long SpendableOutputDescriptor_clone(long orig); // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output); @@ -3146,6 +3685,8 @@ public class bindings { public static native long SpendableOutputDescriptor_read(byte[] ser); // void BaseSign_free(struct LDKBaseSign this_ptr); public static native void BaseSign_free(long this_ptr); + // uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg); + public static native long Sign_clone_ptr(long arg); // struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig); public static native long Sign_clone(long orig); // void Sign_free(struct LDKSign this_ptr); @@ -3178,6 +3719,8 @@ public class bindings { public static native byte[] InMemorySigner_get_commitment_seed(long this_ptr); // void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); public static native void InMemorySigner_set_commitment_seed(long this_ptr, byte[] val); + // uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg); + public static native long InMemorySigner_clone_ptr(long arg); // struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig); public static native long InMemorySigner_clone(long orig); // MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id); @@ -3230,6 +3773,8 @@ public class bindings { public static native void ChainParameters_set_best_block(long this_ptr, long val); // MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg); public static native long ChainParameters_new(Network network_arg, long best_block_arg); + // uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg); + public static native long ChainParameters_clone_ptr(long arg); // struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig); public static native long ChainParameters_clone(long orig); // void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj); @@ -3248,6 +3793,8 @@ public class bindings { public static native void CounterpartyForwardingInfo_set_cltv_expiry_delta(long this_ptr, short val); // MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg); public static native long CounterpartyForwardingInfo_new(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg); + // uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg); + public static native long CounterpartyForwardingInfo_clone_ptr(long arg); // struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig); public static native long CounterpartyForwardingInfo_clone(long orig); // void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj); @@ -3270,6 +3817,8 @@ public class bindings { public static native void ChannelCounterparty_set_forwarding_info(long this_ptr, long val); // MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg); public static native long ChannelCounterparty_new(byte[] node_id_arg, long features_arg, long unspendable_punishment_reserve_arg, long forwarding_info_arg); + // uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg); + public static native long ChannelCounterparty_clone_ptr(long arg); // struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig); public static native long ChannelCounterparty_clone(long orig); // void ChannelDetails_free(struct LDKChannelDetails this_obj); @@ -3336,10 +3885,14 @@ public class bindings { public static native void ChannelDetails_set_is_public(long this_ptr, boolean val); // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg); public static native long ChannelDetails_new(byte[] channel_id_arg, long counterparty_arg, long funding_txo_arg, long short_channel_id_arg, long channel_value_satoshis_arg, long unspendable_punishment_reserve_arg, long user_channel_id_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, long confirmations_required_arg, long force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg); + // uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg); + public static native long ChannelDetails_clone_ptr(long arg); // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); public static native long ChannelDetails_clone(long orig); // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); public static native void PaymentSendFailure_free(long this_ptr); + // uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg); + public static native long PaymentSendFailure_clone_ptr(long arg); // struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig); public static native long PaymentSendFailure_clone(long orig); // struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a); @@ -3442,6 +3995,8 @@ public class bindings { public static native long C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, long arg); // void DecodeError_free(struct LDKDecodeError this_obj); public static native void DecodeError_free(long this_obj); + // uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg); + public static native long DecodeError_clone_ptr(long arg); // struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig); public static native long DecodeError_clone(long orig); // void Init_free(struct LDKInit this_obj); @@ -3452,6 +4007,8 @@ public class bindings { public static native void Init_set_features(long this_ptr, long val); // MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg); public static native long Init_new(long features_arg); + // uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg); + public static native long Init_clone_ptr(long arg); // struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig); public static native long Init_clone(long orig); // void ErrorMessage_free(struct LDKErrorMessage this_obj); @@ -3466,6 +4023,8 @@ public class bindings { public static native void ErrorMessage_set_data(long this_ptr, String val); // MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg); public static native long ErrorMessage_new(byte[] channel_id_arg, String data_arg); + // uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg); + public static native long ErrorMessage_clone_ptr(long arg); // struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); public static native long ErrorMessage_clone(long orig); // void Ping_free(struct LDKPing this_obj); @@ -3480,6 +4039,8 @@ public class bindings { public static native void Ping_set_byteslen(long this_ptr, short val); // MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg); public static native long Ping_new(short ponglen_arg, short byteslen_arg); + // uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg); + public static native long Ping_clone_ptr(long arg); // struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig); public static native long Ping_clone(long orig); // void Pong_free(struct LDKPong this_obj); @@ -3490,6 +4051,8 @@ public class bindings { public static native void Pong_set_byteslen(long this_ptr, short val); // MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg); public static native long Pong_new(short byteslen_arg); + // uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg); + public static native long Pong_clone_ptr(long arg); // struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig); public static native long Pong_clone(long orig); // void OpenChannel_free(struct LDKOpenChannel this_obj); @@ -3566,6 +4129,8 @@ public class bindings { public static native byte OpenChannel_get_channel_flags(long this_ptr); // void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val); public static native void OpenChannel_set_channel_flags(long this_ptr, byte val); + // uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg); + public static native long OpenChannel_clone_ptr(long arg); // struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); public static native long OpenChannel_clone(long orig); // void AcceptChannel_free(struct LDKAcceptChannel this_obj); @@ -3626,6 +4191,8 @@ public class bindings { public static native byte[] AcceptChannel_get_first_per_commitment_point(long this_ptr); // void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void AcceptChannel_set_first_per_commitment_point(long this_ptr, byte[] val); + // uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg); + public static native long AcceptChannel_clone_ptr(long arg); // struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); public static native long AcceptChannel_clone(long orig); // void FundingCreated_free(struct LDKFundingCreated this_obj); @@ -3648,6 +4215,8 @@ public class bindings { public static native void FundingCreated_set_signature(long this_ptr, byte[] val); // MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKSignature signature_arg); public static native long FundingCreated_new(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg); + // uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg); + public static native long FundingCreated_clone_ptr(long arg); // struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); public static native long FundingCreated_clone(long orig); // void FundingSigned_free(struct LDKFundingSigned this_obj); @@ -3662,6 +4231,8 @@ public class bindings { public static native void FundingSigned_set_signature(long this_ptr, byte[] val); // MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg); public static native long FundingSigned_new(byte[] channel_id_arg, byte[] signature_arg); + // uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg); + public static native long FundingSigned_clone_ptr(long arg); // struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); public static native long FundingSigned_clone(long orig); // void FundingLocked_free(struct LDKFundingLocked this_obj); @@ -3676,6 +4247,8 @@ public class bindings { public static native void FundingLocked_set_next_per_commitment_point(long this_ptr, byte[] val); // MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg); public static native long FundingLocked_new(byte[] channel_id_arg, byte[] next_per_commitment_point_arg); + // uint64_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg); + public static native long FundingLocked_clone_ptr(long arg); // struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); public static native long FundingLocked_clone(long orig); // void Shutdown_free(struct LDKShutdown this_obj); @@ -3690,6 +4263,8 @@ public class bindings { public static native void Shutdown_set_scriptpubkey(long this_ptr, byte[] val); // MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg); public static native long Shutdown_new(byte[] channel_id_arg, byte[] scriptpubkey_arg); + // uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg); + public static native long Shutdown_clone_ptr(long arg); // struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); public static native long Shutdown_clone(long orig); // void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj); @@ -3704,6 +4279,8 @@ public class bindings { public static native void ClosingSignedFeeRange_set_max_fee_satoshis(long this_ptr, long val); // MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg); public static native long ClosingSignedFeeRange_new(long min_fee_satoshis_arg, long max_fee_satoshis_arg); + // uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg); + public static native long ClosingSignedFeeRange_clone_ptr(long arg); // struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig); public static native long ClosingSignedFeeRange_clone(long orig); // void ClosingSigned_free(struct LDKClosingSigned this_obj); @@ -3726,6 +4303,8 @@ public class bindings { public static native void ClosingSigned_set_fee_range(long this_ptr, long val); // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg); public static native long ClosingSigned_new(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, long fee_range_arg); + // uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg); + public static native long ClosingSigned_clone_ptr(long arg); // struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); public static native long ClosingSigned_clone(long orig); // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj); @@ -3750,6 +4329,8 @@ public class bindings { public static native int UpdateAddHTLC_get_cltv_expiry(long this_ptr); // void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val); public static native void UpdateAddHTLC_set_cltv_expiry(long this_ptr, int val); + // uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg); + public static native long UpdateAddHTLC_clone_ptr(long arg); // struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); public static native long UpdateAddHTLC_clone(long orig); // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj); @@ -3768,6 +4349,8 @@ public class bindings { public static native void UpdateFulfillHTLC_set_payment_preimage(long this_ptr, byte[] val); // MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg); public static native long UpdateFulfillHTLC_new(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg); + // uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg); + public static native long UpdateFulfillHTLC_clone_ptr(long arg); // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); public static native long UpdateFulfillHTLC_clone(long orig); // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj); @@ -3780,6 +4363,8 @@ public class bindings { public static native long UpdateFailHTLC_get_htlc_id(long this_ptr); // void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val); public static native void UpdateFailHTLC_set_htlc_id(long this_ptr, long val); + // uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg); + public static native long UpdateFailHTLC_clone_ptr(long arg); // struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig); public static native long UpdateFailHTLC_clone(long orig); // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj); @@ -3796,6 +4381,8 @@ public class bindings { public static native short UpdateFailMalformedHTLC_get_failure_code(long this_ptr); // void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val); public static native void UpdateFailMalformedHTLC_set_failure_code(long this_ptr, short val); + // uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg); + public static native long UpdateFailMalformedHTLC_clone_ptr(long arg); // struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig); public static native long UpdateFailMalformedHTLC_clone(long orig); // void CommitmentSigned_free(struct LDKCommitmentSigned this_obj); @@ -3812,6 +4399,8 @@ public class bindings { public static native void CommitmentSigned_set_htlc_signatures(long this_ptr, byte[][] val); // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg); public static native long CommitmentSigned_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg); + // uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg); + public static native long CommitmentSigned_clone_ptr(long arg); // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); public static native long CommitmentSigned_clone(long orig); // void RevokeAndACK_free(struct LDKRevokeAndACK this_obj); @@ -3830,6 +4419,8 @@ public class bindings { public static native void RevokeAndACK_set_next_per_commitment_point(long this_ptr, byte[] val); // MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg); public static native long RevokeAndACK_new(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg); + // uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg); + public static native long RevokeAndACK_clone_ptr(long arg); // struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); public static native long RevokeAndACK_clone(long orig); // void UpdateFee_free(struct LDKUpdateFee this_obj); @@ -3844,6 +4435,8 @@ public class bindings { public static native void UpdateFee_set_feerate_per_kw(long this_ptr, int val); // MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg); public static native long UpdateFee_new(byte[] channel_id_arg, int feerate_per_kw_arg); + // uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg); + public static native long UpdateFee_clone_ptr(long arg); // struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); public static native long UpdateFee_clone(long orig); // void DataLossProtect_free(struct LDKDataLossProtect this_obj); @@ -3858,6 +4451,8 @@ public class bindings { public static native void DataLossProtect_set_my_current_per_commitment_point(long this_ptr, byte[] val); // MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg); public static native long DataLossProtect_new(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg); + // uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg); + public static native long DataLossProtect_clone_ptr(long arg); // struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); public static native long DataLossProtect_clone(long orig); // void ChannelReestablish_free(struct LDKChannelReestablish this_obj); @@ -3874,6 +4469,8 @@ public class bindings { public static native long ChannelReestablish_get_next_remote_commitment_number(long this_ptr); // void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelReestablish_set_next_remote_commitment_number(long this_ptr, long val); + // uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg); + public static native long ChannelReestablish_clone_ptr(long arg); // struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); public static native long ChannelReestablish_clone(long orig); // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj); @@ -3896,10 +4493,14 @@ public class bindings { public static native void AnnouncementSignatures_set_bitcoin_signature(long this_ptr, byte[] val); // MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg); public static native long AnnouncementSignatures_new(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg); + // uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg); + public static native long AnnouncementSignatures_clone_ptr(long arg); // struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig); public static native long AnnouncementSignatures_clone(long orig); // void NetAddress_free(struct LDKNetAddress this_ptr); public static native void NetAddress_free(long this_ptr); + // uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg); + public static native long NetAddress_clone_ptr(long arg); // struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig); public static native long NetAddress_clone(long orig); // struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port); @@ -3938,6 +4539,8 @@ public class bindings { public static native void UnsignedNodeAnnouncement_set_alias(long this_ptr, byte[] val); // void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); public static native void UnsignedNodeAnnouncement_set_addresses(long this_ptr, long[] val); + // uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg); + public static native long UnsignedNodeAnnouncement_clone_ptr(long arg); // struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); public static native long UnsignedNodeAnnouncement_clone(long orig); // void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj); @@ -3952,6 +4555,8 @@ public class bindings { public static native void NodeAnnouncement_set_contents(long this_ptr, long val); // MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg); public static native long NodeAnnouncement_new(byte[] signature_arg, long contents_arg); + // uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg); + public static native long NodeAnnouncement_clone_ptr(long arg); // struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); public static native long NodeAnnouncement_clone(long orig); // void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj); @@ -3984,6 +4589,8 @@ public class bindings { public static native byte[] UnsignedChannelAnnouncement_get_bitcoin_key_2(long this_ptr); // void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); public static native void UnsignedChannelAnnouncement_set_bitcoin_key_2(long this_ptr, byte[] val); + // uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg); + public static native long UnsignedChannelAnnouncement_clone_ptr(long arg); // struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); public static native long UnsignedChannelAnnouncement_clone(long orig); // void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj); @@ -4010,6 +4617,8 @@ public class bindings { public static native void ChannelAnnouncement_set_contents(long this_ptr, long val); // MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg); public static native long ChannelAnnouncement_new(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, long contents_arg); + // uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg); + public static native long ChannelAnnouncement_clone_ptr(long arg); // struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); public static native long ChannelAnnouncement_clone(long orig); // void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj); @@ -4046,6 +4655,8 @@ public class bindings { public static native int UnsignedChannelUpdate_get_fee_proportional_millionths(long this_ptr); // void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); public static native void UnsignedChannelUpdate_set_fee_proportional_millionths(long this_ptr, int val); + // uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg); + public static native long UnsignedChannelUpdate_clone_ptr(long arg); // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); public static native long UnsignedChannelUpdate_clone(long orig); // void ChannelUpdate_free(struct LDKChannelUpdate this_obj); @@ -4060,6 +4671,8 @@ public class bindings { public static native void ChannelUpdate_set_contents(long this_ptr, long val); // MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg); public static native long ChannelUpdate_new(byte[] signature_arg, long contents_arg); + // uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg); + public static native long ChannelUpdate_clone_ptr(long arg); // struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); public static native long ChannelUpdate_clone(long orig); // void QueryChannelRange_free(struct LDKQueryChannelRange this_obj); @@ -4078,6 +4691,8 @@ public class bindings { public static native void QueryChannelRange_set_number_of_blocks(long this_ptr, int val); // MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg); public static native long QueryChannelRange_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg); + // uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg); + public static native long QueryChannelRange_clone_ptr(long arg); // struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); public static native long QueryChannelRange_clone(long orig); // void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj); @@ -4102,6 +4717,8 @@ public class bindings { public static native void ReplyChannelRange_set_short_channel_ids(long this_ptr, long[] val); // MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg); public static native long ReplyChannelRange_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg); + // uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg); + public static native long ReplyChannelRange_clone_ptr(long arg); // struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); public static native long ReplyChannelRange_clone(long orig); // void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj); @@ -4114,6 +4731,8 @@ public class bindings { public static native void QueryShortChannelIds_set_short_channel_ids(long this_ptr, long[] val); // MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg); public static native long QueryShortChannelIds_new(byte[] chain_hash_arg, long[] short_channel_ids_arg); + // uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg); + public static native long QueryShortChannelIds_clone_ptr(long arg); // struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); public static native long QueryShortChannelIds_clone(long orig); // void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj); @@ -4128,6 +4747,8 @@ public class bindings { public static native void ReplyShortChannelIdsEnd_set_full_information(long this_ptr, boolean val); // MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg); public static native long ReplyShortChannelIdsEnd_new(byte[] chain_hash_arg, boolean full_information_arg); + // uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg); + public static native long ReplyShortChannelIdsEnd_clone_ptr(long arg); // struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); public static native long ReplyShortChannelIdsEnd_clone(long orig); // void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj); @@ -4146,10 +4767,14 @@ public class bindings { public static native void GossipTimestampFilter_set_timestamp_range(long this_ptr, int val); // MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg); public static native long GossipTimestampFilter_new(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg); + // uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg); + public static native long GossipTimestampFilter_clone_ptr(long arg); // struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); public static native long GossipTimestampFilter_clone(long orig); // void ErrorAction_free(struct LDKErrorAction this_ptr); public static native void ErrorAction_free(long this_ptr); + // uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg); + public static native long ErrorAction_clone_ptr(long arg); // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); public static native long ErrorAction_clone(long orig); // struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg); @@ -4172,6 +4797,8 @@ public class bindings { public static native void LightningError_set_action(long this_ptr, long val); // MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg); public static native long LightningError_new(String err_arg, long action_arg); + // uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg); + public static native long LightningError_clone_ptr(long arg); // struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig); public static native long LightningError_clone(long orig); // void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj); @@ -4202,6 +4829,8 @@ public class bindings { public static native void CommitmentUpdate_set_commitment_signed(long this_ptr, long val); // MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg); public static native long CommitmentUpdate_new(long[] update_add_htlcs_arg, long[] update_fulfill_htlcs_arg, long[] update_fail_htlcs_arg, long[] update_fail_malformed_htlcs_arg, long update_fee_arg, long commitment_signed_arg); + // uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg); + public static native long CommitmentUpdate_clone_ptr(long arg); // struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig); public static native long CommitmentUpdate_clone(long orig); // void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr); @@ -4372,6 +5001,8 @@ public class bindings { public static native void MessageHandler_set_route_handler(long this_ptr, long val); // MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg); public static native long MessageHandler_new(long chan_handler_arg, long route_handler_arg); + // uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg); + public static native long SocketDescriptor_clone_ptr(long arg); // struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig); public static native long SocketDescriptor_clone(long orig); // void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr); @@ -4384,6 +5015,8 @@ public class bindings { public static native void PeerHandleError_set_no_connection_possible(long this_ptr, boolean val); // MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg); public static native long PeerHandleError_new(boolean no_connection_possible_arg); + // uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg); + public static native long PeerHandleError_clone_ptr(long arg); // struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig); public static native long PeerHandleError_clone(long orig); // void PeerManager_free(struct LDKPeerManager this_obj); @@ -4446,6 +5079,8 @@ public class bindings { public static native void TxCreationKeys_set_broadcaster_delayed_payment_key(long this_ptr, byte[] val); // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg); public static native long TxCreationKeys_new(byte[] per_commitment_point_arg, byte[] revocation_key_arg, byte[] broadcaster_htlc_key_arg, byte[] countersignatory_htlc_key_arg, byte[] broadcaster_delayed_payment_key_arg); + // uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg); + public static native long TxCreationKeys_clone_ptr(long arg); // struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig); public static native long TxCreationKeys_clone(long orig); // struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj); @@ -4476,6 +5111,8 @@ public class bindings { public static native void ChannelPublicKeys_set_htlc_basepoint(long this_ptr, byte[] val); // MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg); public static native long ChannelPublicKeys_new(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg); + // uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg); + public static native long ChannelPublicKeys_clone_ptr(long arg); // struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig); public static native long ChannelPublicKeys_clone(long orig); // struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj); @@ -4512,6 +5149,8 @@ public class bindings { public static native void HTLCOutputInCommitment_set_transaction_output_index(long this_ptr, long val); // MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg); public static native long HTLCOutputInCommitment_new(boolean offered_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, long transaction_output_index_arg); + // uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg); + public static native long HTLCOutputInCommitment_clone_ptr(long arg); // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); public static native long HTLCOutputInCommitment_clone(long orig); // struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); @@ -4548,6 +5187,8 @@ public class bindings { public static native void ChannelTransactionParameters_set_funding_outpoint(long this_ptr, long val); // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg); public static native long ChannelTransactionParameters_new(long holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, long counterparty_parameters_arg, long funding_outpoint_arg); + // uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg); + public static native long ChannelTransactionParameters_clone_ptr(long arg); // struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); public static native long ChannelTransactionParameters_clone(long orig); // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj); @@ -4562,6 +5203,8 @@ public class bindings { public static native void CounterpartyChannelTransactionParameters_set_selected_contest_delay(long this_ptr, short val); // MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg); public static native long CounterpartyChannelTransactionParameters_new(long pubkeys_arg, short selected_contest_delay_arg); + // uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg); + public static native long CounterpartyChannelTransactionParameters_clone_ptr(long arg); // struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig); public static native long CounterpartyChannelTransactionParameters_clone(long orig); // MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); @@ -4598,6 +5241,8 @@ public class bindings { public static native void HolderCommitmentTransaction_set_counterparty_sig(long this_ptr, byte[] val); // void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); public static native void HolderCommitmentTransaction_set_counterparty_htlc_sigs(long this_ptr, byte[][] val); + // uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg); + public static native long HolderCommitmentTransaction_clone_ptr(long arg); // struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig); public static native long HolderCommitmentTransaction_clone(long orig); // struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj); @@ -4618,6 +5263,8 @@ public class bindings { public static native void BuiltCommitmentTransaction_set_txid(long this_ptr, byte[] val); // MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg); public static native long BuiltCommitmentTransaction_new(byte[] transaction_arg, byte[] txid_arg); + // uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg); + public static native long BuiltCommitmentTransaction_clone_ptr(long arg); // struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig); public static native long BuiltCommitmentTransaction_clone(long orig); // struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj); @@ -4630,6 +5277,8 @@ public class bindings { public static native byte[] BuiltCommitmentTransaction_sign(long this_arg, byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis); // void ClosingTransaction_free(struct LDKClosingTransaction this_obj); public static native void ClosingTransaction_free(long this_obj); + // uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg); + public static native long ClosingTransaction_clone_ptr(long arg); // struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig); public static native long ClosingTransaction_clone(long orig); // uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o); @@ -4658,6 +5307,8 @@ public class bindings { public static native byte[] TrustedClosingTransaction_sign(long this_arg, byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis); // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj); public static native void CommitmentTransaction_free(long this_obj); + // uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg); + public static native long CommitmentTransaction_clone_ptr(long arg); // struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig); public static native long CommitmentTransaction_clone(long orig); // struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj); @@ -4696,12 +5347,20 @@ public class bindings { public static native boolean ChannelFeatures_eq(long a, long b); // bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b); public static native boolean InvoiceFeatures_eq(long a, long b); + // uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); + public static native long InitFeatures_clone_ptr(long arg); // struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig); public static native long InitFeatures_clone(long orig); + // uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg); + public static native long NodeFeatures_clone_ptr(long arg); // struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig); public static native long NodeFeatures_clone(long orig); + // uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg); + public static native long ChannelFeatures_clone_ptr(long arg); // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); public static native long ChannelFeatures_clone(long orig); + // uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg); + public static native long InvoiceFeatures_clone_ptr(long arg); // struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig); public static native long InvoiceFeatures_clone(long orig); // void InitFeatures_free(struct LDKInitFeatures this_obj); @@ -4760,6 +5419,8 @@ public class bindings { public static native long InvoiceFeatures_read(byte[] ser); // void ShutdownScript_free(struct LDKShutdownScript this_obj); public static native void ShutdownScript_free(long this_obj); + // uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg); + public static native long ShutdownScript_clone_ptr(long arg); // struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig); public static native long ShutdownScript_clone(long orig); // void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj); @@ -4770,6 +5431,8 @@ public class bindings { public static native void InvalidShutdownScript_set_script(long this_ptr, byte[] val); // MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg); public static native long InvalidShutdownScript_new(byte[] script_arg); + // uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg); + public static native long InvalidShutdownScript_clone_ptr(long arg); // struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig); public static native long InvalidShutdownScript_clone(long orig); // struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj); @@ -4790,6 +5453,8 @@ public class bindings { public static native boolean ShutdownScript_is_compatible(long this_arg, long features); // void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr); public static native void CustomMessageReader_free(long this_ptr); + // uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg); + public static native long Type_clone_ptr(long arg); // struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig); public static native long Type_clone(long orig); // void Type_free(struct LDKType this_ptr); @@ -4804,6 +5469,8 @@ public class bindings { public static native byte[] LockableScore_write(long obj); // void NodeId_free(struct LDKNodeId this_obj); public static native void NodeId_free(long this_obj); + // uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg); + public static native long NodeId_clone_ptr(long arg); // struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig); public static native long NodeId_clone(long orig); // MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey); @@ -4818,12 +5485,16 @@ public class bindings { public static native long NodeId_read(byte[] ser); // void NetworkGraph_free(struct LDKNetworkGraph this_obj); public static native void NetworkGraph_free(long this_obj); + // uint64_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg); + public static native long NetworkGraph_clone_ptr(long arg); // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig); public static native long NetworkGraph_clone(long orig); // void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj); public static native void ReadOnlyNetworkGraph_free(long this_obj); // void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr); public static native void NetworkUpdate_free(long this_ptr); + // uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg); + public static native long NetworkUpdate_clone_ptr(long arg); // struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig); public static native long NetworkUpdate_clone(long orig); // struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg); @@ -4834,6 +5505,8 @@ public class bindings { public static native long NetworkUpdate_node_failure(byte[] node_id, boolean is_permanent); // struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj); public static native byte[] NetworkUpdate_write(long obj); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser); + public static native long NetworkUpdate_read(byte[] ser); // struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); public static native long NetGraphMsgHandler_as_EventHandler(long this_arg); // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj); @@ -4878,6 +5551,8 @@ public class bindings { public static native void DirectionalChannelInfo_set_last_update_message(long this_ptr, long val); // MUST_USE_RES struct LDKDirectionalChannelInfo DirectionalChannelInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg); public static native long DirectionalChannelInfo_new(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, long fees_arg, long last_update_message_arg); + // uint64_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg); + public static native long DirectionalChannelInfo_clone_ptr(long arg); // struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig); public static native long DirectionalChannelInfo_clone(long orig); // struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj); @@ -4916,6 +5591,8 @@ public class bindings { public static native void ChannelInfo_set_announcement_message(long this_ptr, long val); // MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKNodeId node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKNodeId node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg); public static native long ChannelInfo_new(long features_arg, long node_one_arg, long one_to_two_arg, long node_two_arg, long two_to_one_arg, long capacity_sats_arg, long announcement_message_arg); + // uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg); + public static native long ChannelInfo_clone_ptr(long arg); // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig); public static native long ChannelInfo_clone(long orig); // struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); @@ -4936,6 +5613,8 @@ public class bindings { public static native long RoutingFees_new(int base_msat_arg, int proportional_millionths_arg); // bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b); public static native boolean RoutingFees_eq(long a, long b); + // uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg); + public static native long RoutingFees_clone_ptr(long arg); // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); public static native long RoutingFees_clone(long orig); // uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o); @@ -4970,6 +5649,8 @@ public class bindings { public static native void NodeAnnouncementInfo_set_announcement_message(long this_ptr, long val); // MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg); public static native long NodeAnnouncementInfo_new(long features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, long[] addresses_arg, long announcement_message_arg); + // uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg); + public static native long NodeAnnouncementInfo_clone_ptr(long arg); // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig); public static native long NodeAnnouncementInfo_clone(long orig); // struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); @@ -4990,6 +5671,8 @@ public class bindings { public static native void NodeInfo_set_announcement_info(long this_ptr, long val); // MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); public static native long NodeInfo_new(long[] channels_arg, long lowest_inbound_channel_fees_arg, long announcement_info_arg); + // uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg); + public static native long NodeInfo_clone_ptr(long arg); // struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig); public static native long NodeInfo_clone(long orig); // struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); @@ -5050,6 +5733,8 @@ public class bindings { public static native void RouteHop_set_cltv_expiry_delta(long this_ptr, int val); // MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); public static native long RouteHop_new(byte[] pubkey_arg, long node_features_arg, long short_channel_id_arg, long channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg); + // uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg); + public static native long RouteHop_clone_ptr(long arg); // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); public static native long RouteHop_clone(long orig); // uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o); @@ -5072,6 +5757,8 @@ public class bindings { public static native void Route_set_payee(long this_ptr, long val); // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPayee payee_arg); public static native long Route_new(long[][] paths_arg, long payee_arg); + // uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg); + public static native long Route_clone_ptr(long arg); // struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); public static native long Route_clone(long orig); // uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o); @@ -5102,6 +5789,8 @@ public class bindings { public static native void RouteParameters_set_final_cltv_expiry_delta(long this_ptr, int val); // MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPayee payee_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg); public static native long RouteParameters_new(long payee_arg, long final_value_msat_arg, int final_cltv_expiry_delta_arg); + // uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg); + public static native long RouteParameters_clone_ptr(long arg); // struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig); public static native long RouteParameters_clone(long orig); // struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj); @@ -5128,6 +5817,8 @@ public class bindings { public static native void Payee_set_expiry_time(long this_ptr, long val); // MUST_USE_RES struct LDKPayee Payee_new(struct LDKPublicKey pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg); public static native long Payee_new(byte[] pubkey_arg, long features_arg, long[] route_hints_arg, long expiry_time_arg); + // uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg); + public static native long Payee_clone_ptr(long arg); // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig); public static native long Payee_clone(long orig); // uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o); @@ -5150,6 +5841,8 @@ public class bindings { public static native void RouteHint_set_a(long this_ptr, long[] val); // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg); public static native long RouteHint_new(long[] a_arg); + // uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg); + public static native long RouteHint_clone_ptr(long arg); // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); public static native long RouteHint_clone(long orig); // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o); @@ -5188,6 +5881,8 @@ public class bindings { public static native void RouteHintHop_set_htlc_maximum_msat(long this_ptr, long val); // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); public static native long RouteHintHop_new(byte[] src_node_id_arg, long short_channel_id_arg, long fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg); + // uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg); + public static native long RouteHintHop_clone_ptr(long arg); // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); public static native long RouteHintHop_clone(long orig); // uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o); @@ -5262,12 +5957,16 @@ public class bindings { public static native void Invoice_free(long this_obj); // bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b); public static native boolean Invoice_eq(long a, long b); + // uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg); + public static native long Invoice_clone_ptr(long arg); // struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig); public static native long Invoice_clone(long orig); // void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj); public static native void SignedRawInvoice_free(long this_obj); // bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b); public static native boolean SignedRawInvoice_eq(long a, long b); + // uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg); + public static native long SignedRawInvoice_clone_ptr(long arg); // struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig); public static native long SignedRawInvoice_clone(long orig); // void RawInvoice_free(struct LDKRawInvoice this_obj); @@ -5278,6 +5977,8 @@ public class bindings { public static native void RawInvoice_set_data(long this_ptr, long val); // bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b); public static native boolean RawInvoice_eq(long a, long b); + // uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg); + public static native long RawInvoice_clone_ptr(long arg); // struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig); public static native long RawInvoice_clone(long orig); // void RawDataPart_free(struct LDKRawDataPart this_obj); @@ -5288,12 +5989,16 @@ public class bindings { public static native void RawDataPart_set_timestamp(long this_ptr, long val); // bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b); public static native boolean RawDataPart_eq(long a, long b); + // uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg); + public static native long RawDataPart_clone_ptr(long arg); // struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig); public static native long RawDataPart_clone(long orig); // void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj); public static native void PositiveTimestamp_free(long this_obj); // bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b); public static native boolean PositiveTimestamp_eq(long a, long b); + // uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg); + public static native long PositiveTimestamp_clone_ptr(long arg); // struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig); public static native long PositiveTimestamp_clone(long orig); // enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig); @@ -5328,6 +6033,8 @@ public class bindings { public static native boolean Currency_eq(long a, long b); // void Sha256_free(struct LDKSha256 this_obj); public static native void Sha256_free(long this_obj); + // uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg); + public static native long Sha256_clone_ptr(long arg); // struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig); public static native long Sha256_clone(long orig); // uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o); @@ -5336,6 +6043,8 @@ public class bindings { public static native boolean Sha256_eq(long a, long b); // void Description_free(struct LDKDescription this_obj); public static native void Description_free(long this_obj); + // uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg); + public static native long Description_clone_ptr(long arg); // struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig); public static native long Description_clone(long orig); // uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o); @@ -5350,6 +6059,8 @@ public class bindings { public static native void PayeePubKey_set_a(long this_ptr, byte[] val); // MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg); public static native long PayeePubKey_new(byte[] a_arg); + // uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg); + public static native long PayeePubKey_clone_ptr(long arg); // struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig); public static native long PayeePubKey_clone(long orig); // uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o); @@ -5358,6 +6069,8 @@ public class bindings { public static native boolean PayeePubKey_eq(long a, long b); // void ExpiryTime_free(struct LDKExpiryTime this_obj); public static native void ExpiryTime_free(long this_obj); + // uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg); + public static native long ExpiryTime_clone_ptr(long arg); // struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig); public static native long ExpiryTime_clone(long orig); // uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o); @@ -5372,6 +6085,8 @@ public class bindings { public static native void MinFinalCltvExpiry_set_a(long this_ptr, long val); // MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg); public static native long MinFinalCltvExpiry_new(long a_arg); + // uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg); + public static native long MinFinalCltvExpiry_clone_ptr(long arg); // struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig); public static native long MinFinalCltvExpiry_clone(long orig); // uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o); @@ -5380,6 +6095,8 @@ public class bindings { public static native boolean MinFinalCltvExpiry_eq(long a, long b); // void Fallback_free(struct LDKFallback this_ptr); public static native void Fallback_free(long this_ptr); + // uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg); + public static native long Fallback_clone_ptr(long arg); // struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig); public static native long Fallback_clone(long orig); // struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program); @@ -5394,12 +6111,16 @@ public class bindings { public static native boolean Fallback_eq(long a, long b); // void InvoiceSignature_free(struct LDKInvoiceSignature this_obj); public static native void InvoiceSignature_free(long this_obj); + // uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg); + public static native long InvoiceSignature_clone_ptr(long arg); // struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig); public static native long InvoiceSignature_clone(long orig); // bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b); public static native boolean InvoiceSignature_eq(long a, long b); // void PrivateRoute_free(struct LDKPrivateRoute this_obj); public static native void PrivateRoute_free(long this_obj); + // uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg); + public static native long PrivateRoute_clone_ptr(long arg); // struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig); public static native long PrivateRoute_clone(long orig); // uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o); @@ -5540,6 +6261,8 @@ public class bindings { public static native String SemanticError_to_str(long o); // void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr); public static native void SignOrCreationError_free(long this_ptr); + // uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg); + public static native long SignOrCreationError_clone_ptr(long arg); // struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig); public static native long SignOrCreationError_clone(long orig); // struct LDKSignOrCreationError SignOrCreationError_sign_error(void); @@ -5564,6 +6287,8 @@ public class bindings { public static native void RetryAttempts_set_a(long this_ptr, long val); // MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg); public static native long RetryAttempts_new(long a_arg); + // uint64_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg); + public static native long RetryAttempts_clone_ptr(long arg); // struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig); public static native long RetryAttempts_clone(long orig); // bool RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b); @@ -5572,6 +6297,8 @@ public class bindings { public static native long RetryAttempts_hash(long o); // void PaymentError_free(struct LDKPaymentError this_ptr); public static native void PaymentError_free(long this_ptr); + // uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg); + public static native long PaymentError_clone_ptr(long arg); // struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig); public static native long PaymentError_clone(long orig); // struct LDKPaymentError PaymentError_invoice(struct LDKStr a); diff --git a/src/main/java/org/ldk/structs/APIError.java b/src/main/java/org/ldk/structs/APIError.java index e2613fd9..1410b0e5 100644 --- a/src/main/java/org/ldk/structs/APIError.java +++ b/src/main/java/org/ldk/structs/APIError.java @@ -42,6 +42,10 @@ public class APIError extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * Indicates the API was wholly misused (see err for more). Cases where these can be returned + * are documented, but generally indicates some precondition of a function was violated. + */ public final static class APIMisuseError extends APIError { /** * A human-readable error message @@ -52,6 +56,11 @@ public class APIError extends CommonBase { this.err = obj.err; } } + /** + * Due to a high feerate, we were unable to complete the request. + * For example, this may be returned if the feerate implies we cannot open a channel at the + * requested value, but opening a larger channel would succeed. + */ public final static class FeeRateTooHigh extends APIError { /** * A human-readable error message @@ -67,6 +76,10 @@ public class APIError extends CommonBase { this.feerate = obj.feerate; } } + /** + * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route, + * too-many-hops, etc). + */ public final static class RouteError extends APIError { /** * A human-readable error message @@ -77,6 +90,11 @@ public class APIError extends CommonBase { this.err = obj.err; } } + /** + * We were unable to complete the request as the Channel required to do so is unable to + * complete the request (or was not found). This can take many forms, including disconnected + * peer, channel at capacity, channel shutting down, etc. + */ public final static class ChannelUnavailable extends APIError { /** * A human-readable error message @@ -87,11 +105,25 @@ public class APIError extends CommonBase { this.err = obj.err; } } + /** + * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the + * attempted action to fail. + */ public final static class MonitorUpdateFailed extends APIError { private MonitorUpdateFailed(long ptr, bindings.LDKAPIError.MonitorUpdateFailed obj) { super(null, ptr); } } + /** + * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible + * with the channel counterparty as negotiated in [`InitFeatures`]. + * + * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open + * a channel or cooperatively close one with this peer (and will have to force-close instead). + * + * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey + * [`InitFeatures`]: crate::ln::features::InitFeatures + */ public final static class IncompatibleShutdownScript extends APIError { /** * The incompatible shutdown script. @@ -105,6 +137,11 @@ public class APIError extends CommonBase { this.script = script_hu_conv; } } + long clone_ptr() { + long ret = bindings.APIError_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the APIError */ diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index 09125fe3..ada6053c 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -31,7 +31,7 @@ public class AcceptChannel extends CommonBase { * A temporary channel ID, until the funding outpoint is announced */ public void set_temporary_channel_id(byte[] val) { - bindings.AcceptChannel_set_temporary_channel_id(this.ptr, val); + bindings.AcceptChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -151,7 +151,7 @@ public class AcceptChannel extends CommonBase { * The sender's key controlling the funding transaction */ public void set_funding_pubkey(byte[] val) { - bindings.AcceptChannel_set_funding_pubkey(this.ptr, val); + bindings.AcceptChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -166,7 +166,7 @@ public class AcceptChannel extends CommonBase { * Used to derive a revocation key for transactions broadcast by counterparty */ public void set_revocation_basepoint(byte[] val) { - bindings.AcceptChannel_set_revocation_basepoint(this.ptr, val); + bindings.AcceptChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -181,7 +181,7 @@ public class AcceptChannel extends CommonBase { * A payment key to sender for transactions broadcast by counterparty */ public void set_payment_point(byte[] val) { - bindings.AcceptChannel_set_payment_point(this.ptr, val); + bindings.AcceptChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -196,7 +196,7 @@ public class AcceptChannel extends CommonBase { * Used to derive a payment key to sender for transactions broadcast by sender */ public void set_delayed_payment_basepoint(byte[] val) { - bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, val); + bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -211,7 +211,7 @@ public class AcceptChannel extends CommonBase { * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty */ public void set_htlc_basepoint(byte[] val) { - bindings.AcceptChannel_set_htlc_basepoint(this.ptr, val); + bindings.AcceptChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -226,7 +226,12 @@ public class AcceptChannel extends CommonBase { * The first to-be-broadcast-by-sender transaction's per commitment point */ public void set_first_per_commitment_point(byte[] val) { - bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val); + bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + } + + long clone_ptr() { + long ret = bindings.AcceptChannel_clone_ptr(this.ptr); + return ret; } /** diff --git a/src/main/java/org/ldk/structs/Access.java b/src/main/java/org/ldk/structs/Access.java index 47f0c936..e4c1954e 100644 --- a/src/main/java/org/ldk/structs/Access.java +++ b/src/main/java/org/ldk/structs/Access.java @@ -40,7 +40,7 @@ public class Access extends CommonBase { impl_holder.held = new Access(new bindings.LDKAccess() { @Override public long get_utxo(byte[] genesis_hash, long short_channel_id) { Result_TxOutAccessErrorZ ret = arg.get_utxo(genesis_hash, short_channel_id); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }); @@ -54,7 +54,7 @@ public class Access extends CommonBase { * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id */ public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) { - long ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id); + long ret = bindings.Access_get_utxo(this.ptr, InternalUtils.check_arr_len(genesis_hash, 32), short_channel_id); if (ret >= 0 && ret <= 4096) { return null; } Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); return ret_hu_conv; diff --git a/src/main/java/org/ldk/structs/AnnouncementSignatures.java b/src/main/java/org/ldk/structs/AnnouncementSignatures.java index 61e6ce02..48e31a41 100644 --- a/src/main/java/org/ldk/structs/AnnouncementSignatures.java +++ b/src/main/java/org/ldk/structs/AnnouncementSignatures.java @@ -31,7 +31,7 @@ public class AnnouncementSignatures extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.AnnouncementSignatures_set_channel_id(this.ptr, val); + bindings.AnnouncementSignatures_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -61,7 +61,7 @@ public class AnnouncementSignatures extends CommonBase { * A signature by the node key */ public void set_node_signature(byte[] val) { - bindings.AnnouncementSignatures_set_node_signature(this.ptr, val); + bindings.AnnouncementSignatures_set_node_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** @@ -76,20 +76,25 @@ public class AnnouncementSignatures extends CommonBase { * A signature by the funding key */ public void set_bitcoin_signature(byte[] val) { - bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, val); + bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** * Constructs a new AnnouncementSignatures given each field */ public static AnnouncementSignatures of(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) { - long ret = bindings.AnnouncementSignatures_new(channel_id_arg, short_channel_id_arg, node_signature_arg, bitcoin_signature_arg); + long ret = bindings.AnnouncementSignatures_new(InternalUtils.check_arr_len(channel_id_arg, 32), short_channel_id_arg, InternalUtils.check_arr_len(node_signature_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_arg, 64)); if (ret >= 0 && ret <= 4096) { return null; } AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AnnouncementSignatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.AnnouncementSignatures_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the AnnouncementSignatures */ diff --git a/src/main/java/org/ldk/structs/Balance.java b/src/main/java/org/ldk/structs/Balance.java index 52d28898..429335b4 100644 --- a/src/main/java/org/ldk/structs/Balance.java +++ b/src/main/java/org/ldk/structs/Balance.java @@ -38,6 +38,11 @@ public class Balance extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * The channel is not yet closed (or the commitment or closing transaction has not yet + * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is + * force-closed now. + */ public final static class ClaimableOnChannelClose extends Balance { /** * The amount available to claim, in satoshis, excluding the on-chain fees which will be @@ -49,6 +54,10 @@ public class Balance extends CommonBase { this.claimable_amount_satoshis = obj.claimable_amount_satoshis; } } + /** + * The channel has been closed, and the given balance is ours but awaiting confirmations until + * we consider it spendable. + */ public final static class ClaimableAwaitingConfirmations extends Balance { /** * The amount available to claim, in satoshis, possibly excluding the on-chain fees which @@ -66,6 +75,15 @@ public class Balance extends CommonBase { this.confirmation_height = obj.confirmation_height; } } + /** + * The channel has been closed, and the given balance should be ours but awaiting spending + * transaction confirmation. If the spending transaction does not confirm in time, it is + * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain. + * + * Once the spending transaction confirms, before it has reached enough confirmations to be + * considered safe from chain reorganizations, the balance will instead be provided via + * [`Balance::ClaimableAwaitingConfirmations`]. + */ public final static class ContentiousClaimable extends Balance { /** * The amount available to claim, in satoshis, excluding the on-chain fees which will be @@ -83,6 +101,11 @@ public class Balance extends CommonBase { this.timeout_height = obj.timeout_height; } } + /** + * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain + * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat + * likely to be claimed by our counterparty before we do. + */ public final static class MaybeClaimableHTLCAwaitingTimeout extends Balance { /** * The amount available to claim, in satoshis, excluding the on-chain fees which will be @@ -100,6 +123,11 @@ public class Balance extends CommonBase { this.claimable_height = obj.claimable_height; } } + long clone_ptr() { + long ret = bindings.Balance_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Balance */ diff --git a/src/main/java/org/ldk/structs/BaseSign.java b/src/main/java/org/ldk/structs/BaseSign.java index b502674c..267da1e7 100644 --- a/src/main/java/org/ldk/structs/BaseSign.java +++ b/src/main/java/org/ldk/structs/BaseSign.java @@ -30,7 +30,7 @@ public class BaseSign extends CommonBase { final bindings.LDKBaseSign bindings_instance; BaseSign(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } private BaseSign(bindings.LDKBaseSign arg, ChannelPublicKeys pubkeys) { - super(bindings.LDKBaseSign_new(arg, pubkeys == null ? 0 : pubkeys.ptr & ~1)); + super(bindings.LDKBaseSign_new(arg, pubkeys == null ? 0 : pubkeys.clone_ptr())); this.ptrs_to.add(arg); this.bindings_instance = arg; } @@ -195,66 +195,69 @@ public class BaseSign extends CommonBase { impl_holder.held = new BaseSign(new bindings.LDKBaseSign() { @Override public byte[] get_per_commitment_point(long idx) { byte[] ret = arg.get_per_commitment_point(idx); - return ret; + byte[] result = InternalUtils.check_arr_len(ret, 33); + return result; } @Override public byte[] release_commitment_secret(long idx) { byte[] ret = arg.release_commitment_secret(idx); - return ret; + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; } @Override public long validate_holder_commitment(long holder_tx) { HolderCommitmentTransaction holder_tx_hu_conv = null; if (holder_tx < 0 || holder_tx > 4096) { holder_tx_hu_conv = new HolderCommitmentTransaction(null, holder_tx); } Result_NoneNoneZ ret = arg.validate_holder_commitment(holder_tx_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public byte[] channel_keys_id() { byte[] ret = arg.channel_keys_id(); - return ret; + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; } @Override public long sign_counterparty_commitment(long commitment_tx) { CommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new CommitmentTransaction(null, commitment_tx); } Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long validate_counterparty_revocation(long idx, byte[] secret) { Result_NoneNoneZ ret = arg.validate_counterparty_revocation(idx, secret); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_holder_commitment_and_htlcs(long commitment_tx) { HolderCommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new HolderCommitmentTransaction(null, commitment_tx); } Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) { Result_SignatureNoneZ ret = arg.sign_justice_revoked_output(justice_tx, input, amount, per_commitment_key); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc) { HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new HTLCOutputInCommitment(null, htlc); } Result_SignatureNoneZ ret = arg.sign_justice_revoked_htlc(justice_tx, input, amount, per_commitment_key, htlc_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc) { HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new HTLCOutputInCommitment(null, htlc); } Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_closing_transaction(long closing_tx) { ClosingTransaction closing_tx_hu_conv = null; if (closing_tx < 0 || closing_tx > 4096) { closing_tx_hu_conv = new ClosingTransaction(null, closing_tx); } Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_channel_announcement(long msg) { UnsignedChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UnsignedChannelAnnouncement(null, msg); } Result_SignatureNoneZ ret = arg.sign_channel_announcement(msg_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public void ready_channel(long channel_parameters) { @@ -338,7 +341,7 @@ public class BaseSign extends CommonBase { * forward and it is safe to sign the next counterparty commitment. */ public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) { - long ret = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, secret); + long ret = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, InternalUtils.check_arr_len(secret, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); return ret_hu_conv; @@ -382,7 +385,7 @@ public class BaseSign extends CommonBase { * so). */ public Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) { - long ret = bindings.BaseSign_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, per_commitment_key); + long ret = bindings.BaseSign_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; @@ -408,7 +411,7 @@ public class BaseSign extends CommonBase { * (which is committed to in the BIP 143 signatures). */ public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) { - long ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1); + long ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc == null ? 0 : htlc.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); this.ptrs_to.add(htlc); @@ -435,7 +438,7 @@ public class BaseSign extends CommonBase { * BIP 143 signature. */ public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) { - long ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1); + long ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc == null ? 0 : htlc.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); this.ptrs_to.add(htlc); diff --git a/src/main/java/org/ldk/structs/BestBlock.java b/src/main/java/org/ldk/structs/BestBlock.java index 9d3629eb..a595ed02 100644 --- a/src/main/java/org/ldk/structs/BestBlock.java +++ b/src/main/java/org/ldk/structs/BestBlock.java @@ -19,6 +19,11 @@ public class BestBlock extends CommonBase { if (ptr != 0) { bindings.BestBlock_free(ptr); } } + long clone_ptr() { + long ret = bindings.BestBlock_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the BestBlock */ @@ -46,7 +51,7 @@ public class BestBlock extends CommonBase { * Returns a `BestBlock` as identified by the given block hash and height. */ public static BestBlock of(byte[] block_hash, int height) { - long ret = bindings.BestBlock_new(block_hash, height); + long ret = bindings.BestBlock_new(InternalUtils.check_arr_len(block_hash, 32), height); if (ret >= 0 && ret <= 4096) { return null; } BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java b/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java index ba33bd31..e30cbf02 100644 --- a/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java @@ -52,20 +52,25 @@ public class BuiltCommitmentTransaction extends CommonBase { * multiple times. */ public void set_txid(byte[] val) { - bindings.BuiltCommitmentTransaction_set_txid(this.ptr, val); + bindings.BuiltCommitmentTransaction_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** * Constructs a new BuiltCommitmentTransaction given each field */ public static BuiltCommitmentTransaction of(byte[] transaction_arg, byte[] txid_arg) { - long ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg); + long ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, InternalUtils.check_arr_len(txid_arg, 32)); if (ret >= 0 && ret <= 4096) { return null; } BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BuiltCommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.BuiltCommitmentTransaction_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the BuiltCommitmentTransaction */ @@ -110,7 +115,7 @@ public class BuiltCommitmentTransaction extends CommonBase { * because we are about to broadcast a holder transaction. */ public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { - byte[] ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis); + byte[] ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis); return ret; } diff --git a/src/main/java/org/ldk/structs/ChainMonitor.java b/src/main/java/org/ldk/structs/ChainMonitor.java index c3ccf961..c9a4c6e1 100644 --- a/src/main/java/org/ldk/structs/ChainMonitor.java +++ b/src/main/java/org/ldk/structs/ChainMonitor.java @@ -41,6 +41,7 @@ public class ChainMonitor extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } ChainMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainMonitor(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(chain_source); ret_hu_conv.ptrs_to.add(broadcaster); ret_hu_conv.ptrs_to.add(logger); ret_hu_conv.ptrs_to.add(feeest); diff --git a/src/main/java/org/ldk/structs/ChainParameters.java b/src/main/java/org/ldk/structs/ChainParameters.java index 403a4d36..3d047d0b 100644 --- a/src/main/java/org/ldk/structs/ChainParameters.java +++ b/src/main/java/org/ldk/structs/ChainParameters.java @@ -71,6 +71,11 @@ public class ChainParameters extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChainParameters_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChainParameters */ diff --git a/src/main/java/org/ldk/structs/ChannelAnnouncement.java b/src/main/java/org/ldk/structs/ChannelAnnouncement.java index 808d0a67..9382ad91 100644 --- a/src/main/java/org/ldk/structs/ChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/ChannelAnnouncement.java @@ -31,7 +31,7 @@ public class ChannelAnnouncement extends CommonBase { * Authentication of the announcement by the first public node */ public void set_node_signature_1(byte[] val) { - bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, val); + bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** @@ -46,7 +46,7 @@ public class ChannelAnnouncement extends CommonBase { * Authentication of the announcement by the second public node */ public void set_node_signature_2(byte[] val) { - bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, val); + bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** @@ -61,7 +61,7 @@ public class ChannelAnnouncement extends CommonBase { * Proof of funding UTXO ownership by the first public node */ public void set_bitcoin_signature_1(byte[] val) { - bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, val); + bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** @@ -76,7 +76,7 @@ public class ChannelAnnouncement extends CommonBase { * Proof of funding UTXO ownership by the second public node */ public void set_bitcoin_signature_2(byte[] val) { - bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, val); + bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** @@ -101,13 +101,18 @@ public class ChannelAnnouncement extends CommonBase { * Constructs a new ChannelAnnouncement given each field */ public static ChannelAnnouncement of(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) { - long ret = bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + long ret = bindings.ChannelAnnouncement_new(InternalUtils.check_arr_len(node_signature_1_arg, 64), InternalUtils.check_arr_len(node_signature_2_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_1_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_2_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelAnnouncement_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelAnnouncement */ diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index c1ec909f..e1c95b64 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -314,6 +314,11 @@ public class ChannelConfig extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelConfig_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelConfig */ diff --git a/src/main/java/org/ldk/structs/ChannelCounterparty.java b/src/main/java/org/ldk/structs/ChannelCounterparty.java index db770c86..51de1b27 100644 --- a/src/main/java/org/ldk/structs/ChannelCounterparty.java +++ b/src/main/java/org/ldk/structs/ChannelCounterparty.java @@ -32,7 +32,7 @@ public class ChannelCounterparty extends CommonBase { * The node_id of our counterparty */ public void set_node_id(byte[] val) { - bindings.ChannelCounterparty_set_node_id(this.ptr, val); + bindings.ChannelCounterparty_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -113,13 +113,18 @@ public class ChannelCounterparty extends CommonBase { * Constructs a new ChannelCounterparty given each field */ public static ChannelCounterparty of(byte[] node_id_arg, InitFeatures features_arg, long unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg) { - long ret = bindings.ChannelCounterparty_new(node_id_arg, features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1); + long ret = bindings.ChannelCounterparty_new(InternalUtils.check_arr_len(node_id_arg, 33), features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelCounterparty_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelCounterparty */ diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index 75db7b25..85a710f8 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -37,7 +37,7 @@ public class ChannelDetails extends CommonBase { * lifetime of the channel. */ public void set_channel_id(byte[] val) { - bindings.ChannelDetails_set_channel_id(this.ptr, val); + bindings.ChannelDetails_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -383,13 +383,18 @@ public class ChannelDetails extends CommonBase { * Constructs a new ChannelDetails given each field */ public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_channel_id_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) { - long ret = bindings.ChannelDetails_new(channel_id_arg, counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); + long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); if (ret >= 0 && ret <= 4096) { return null; } ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelDetails(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelDetails_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelDetails */ diff --git a/src/main/java/org/ldk/structs/ChannelFeatures.java b/src/main/java/org/ldk/structs/ChannelFeatures.java index 79e9c605..40add60c 100644 --- a/src/main/java/org/ldk/structs/ChannelFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelFeatures.java @@ -30,6 +30,11 @@ public class ChannelFeatures extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.ChannelFeatures_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelFeatures */ diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java index e4b3e944..1e487f87 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java @@ -125,6 +125,11 @@ public class ChannelHandshakeConfig extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelHandshakeConfig_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelHandshakeConfig */ diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java index b54ed69f..3b16709b 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java @@ -228,6 +228,11 @@ public class ChannelHandshakeLimits extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelHandshakeLimits_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelHandshakeLimits */ diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index c351b052..61b4bce3 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -178,6 +178,11 @@ public class ChannelInfo extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelInfo_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelInfo */ diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index 121809b0..9ec3a287 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -123,7 +123,7 @@ public class ChannelManager extends CommonBase { * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None */ public Result__u832APIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_channel_id, @Nullable UserConfig override_config) { - long ret = bindings.ChannelManager_create_channel(this.ptr, their_network_key, channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : override_config.ptr & ~1); + long ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.check_arr_len(their_network_key, 33), channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : override_config.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -185,7 +185,7 @@ public class ChannelManager extends CommonBase { * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal */ public Result_NoneAPIErrorZ close_channel(byte[] channel_id) { - long ret = bindings.ChannelManager_close_channel(this.ptr, channel_id); + long ret = bindings.ChannelManager_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -213,7 +213,7 @@ public class ChannelManager extends CommonBase { * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal */ public Result_NoneAPIErrorZ close_channel_with_target_feerate(byte[] channel_id, int target_feerate_sats_per_1000_weight) { - long ret = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, channel_id, target_feerate_sats_per_1000_weight); + long ret = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, InternalUtils.check_arr_len(channel_id, 32), target_feerate_sats_per_1000_weight); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -224,7 +224,7 @@ public class ChannelManager extends CommonBase { * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager. */ public Result_NoneAPIErrorZ force_close_channel(byte[] channel_id) { - long ret = bindings.ChannelManager_force_close_channel(this.ptr, channel_id); + long ret = bindings.ChannelManager_force_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -282,7 +282,7 @@ public class ChannelManager extends CommonBase { * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None */ public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) { - long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret); + long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); @@ -300,7 +300,7 @@ public class ChannelManager extends CommonBase { * [`send_payment`]: [`ChannelManager::send_payment`] */ public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) { - long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_id); + long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); @@ -326,7 +326,7 @@ public class ChannelManager extends CommonBase { * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None */ public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ send_spontaneous_payment(Route route, @Nullable byte[] payment_preimage) { - long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_preimage); + long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_preimage, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); @@ -356,7 +356,7 @@ public class ChannelManager extends CommonBase { * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady */ public Result_NoneAPIErrorZ funding_transaction_generated(byte[] temporary_channel_id, byte[] funding_transaction) { - long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id, funding_transaction); + long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), funding_transaction); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -383,7 +383,7 @@ public class ChannelManager extends CommonBase { * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events */ public void broadcast_node_announcement(byte[] rgb, byte[] alias, NetAddress[] addresses) { - bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, addresses != null ? Arrays.stream(addresses).mapToLong(addresses_conv_12 -> addresses_conv_12.ptr).toArray() : null); + bindings.ChannelManager_broadcast_node_announcement(this.ptr, InternalUtils.check_arr_len(rgb, 3), InternalUtils.check_arr_len(alias, 32), addresses != null ? Arrays.stream(addresses).mapToLong(addresses_conv_12 -> addresses_conv_12.ptr).toArray() : null); } /** @@ -420,7 +420,7 @@ public class ChannelManager extends CommonBase { * HTLC backwards has been started. */ public boolean fail_htlc_backwards(byte[] payment_hash) { - boolean ret = bindings.ChannelManager_fail_htlc_backwards(this.ptr, payment_hash); + boolean ret = bindings.ChannelManager_fail_htlc_backwards(this.ptr, InternalUtils.check_arr_len(payment_hash, 32)); return ret; } @@ -440,7 +440,7 @@ public class ChannelManager extends CommonBase { * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash */ public boolean claim_funds(byte[] payment_preimage) { - boolean ret = bindings.ChannelManager_claim_funds(this.ptr, payment_preimage); + boolean ret = bindings.ChannelManager_claim_funds(this.ptr, InternalUtils.check_arr_len(payment_preimage, 32)); return ret; } @@ -526,7 +526,7 @@ public class ChannelManager extends CommonBase { * [`PaymentPurpose::InvoicePayment::user_payment_id`]: events::PaymentPurpose::InvoicePayment::user_payment_id */ public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash(byte[] payment_hash, Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) { - long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, payment_hash, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id); + long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; diff --git a/src/main/java/org/ldk/structs/ChannelManagerPersister.java b/src/main/java/org/ldk/structs/ChannelManagerPersister.java index cac176ad..c27ea3ef 100644 --- a/src/main/java/org/ldk/structs/ChannelManagerPersister.java +++ b/src/main/java/org/ldk/structs/ChannelManagerPersister.java @@ -41,7 +41,7 @@ public class ChannelManagerPersister extends CommonBase { @Override public long persist_manager(long channel_manager) { ChannelManager channel_manager_hu_conv = null; if (channel_manager < 0 || channel_manager > 4096) { channel_manager_hu_conv = new ChannelManager(null, channel_manager); } Result_NoneErrorZ ret = arg.persist_manager(channel_manager_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }); diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index c6604d11..f4546bd4 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -217,7 +217,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming open_channel message from the given peer. */ public void handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) { - bindings.ChannelMessageHandler_handle_open_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -225,7 +225,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming accept_channel message from the given peer. */ public void handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) { - bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -233,7 +233,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming funding_created message from the given peer. */ public void handle_funding_created(byte[] their_node_id, FundingCreated msg) { - bindings.ChannelMessageHandler_handle_funding_created(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -241,7 +241,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming funding_signed message from the given peer. */ public void handle_funding_signed(byte[] their_node_id, FundingSigned msg) { - bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -249,7 +249,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming funding_locked message from the given peer. */ public void handle_funding_locked(byte[] their_node_id, FundingLocked msg) { - bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -257,7 +257,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming shutdown message from the given peer. */ public void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg) { - bindings.ChannelMessageHandler_handle_shutdown(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(their_features); this.ptrs_to.add(msg); } @@ -266,7 +266,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming closing_signed message from the given peer. */ public void handle_closing_signed(byte[] their_node_id, ClosingSigned msg) { - bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -274,7 +274,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming update_add_htlc message from the given peer. */ public void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) { - bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -282,7 +282,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming update_fulfill_htlc message from the given peer. */ public void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -290,7 +290,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming update_fail_htlc message from the given peer. */ public void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -298,7 +298,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming update_fail_malformed_htlc message from the given peer. */ public void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -306,7 +306,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming commitment_signed message from the given peer. */ public void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) { - bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -314,7 +314,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming revoke_and_ack message from the given peer. */ public void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) { - bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -322,7 +322,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming update_fee message from the given peer. */ public void handle_update_fee(byte[] their_node_id, UpdateFee msg) { - bindings.ChannelMessageHandler_handle_update_fee(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -330,7 +330,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming announcement_signatures message from the given peer. */ public void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) { - bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -341,14 +341,14 @@ public class ChannelMessageHandler extends CommonBase { * and any outstanding channels should be failed. */ public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) { - bindings.ChannelMessageHandler_peer_disconnected(this.ptr, their_node_id, no_connection_possible); + bindings.ChannelMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), no_connection_possible); } /** * Handle a peer reconnecting, possibly generating channel_reestablish message(s). */ public void peer_connected(byte[] their_node_id, Init msg) { - bindings.ChannelMessageHandler_peer_connected(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -356,7 +356,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming channel_reestablish message from the given peer. */ public void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) { - bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -364,7 +364,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming channel update from the given peer. */ public void handle_channel_update(byte[] their_node_id, ChannelUpdate msg) { - bindings.ChannelMessageHandler_handle_channel_update(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -372,7 +372,7 @@ public class ChannelMessageHandler extends CommonBase { * Handle an incoming error message from the given peer. */ public void handle_error(byte[] their_node_id, ErrorMessage msg) { - bindings.ChannelMessageHandler_handle_error(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } diff --git a/src/main/java/org/ldk/structs/ChannelMonitor.java b/src/main/java/org/ldk/structs/ChannelMonitor.java index 3e3f9f0d..c9b5444e 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -34,6 +34,11 @@ public class ChannelMonitor extends CommonBase { if (ptr != 0) { bindings.ChannelMonitor_free(ptr); } } + long clone_ptr() { + long ret = bindings.ChannelMonitor_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelMonitor */ @@ -183,7 +188,7 @@ public class ChannelMonitor extends CommonBase { * [`get_outputs_to_watch`]: #method.get_outputs_to_watch */ public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length]; for (int n = 0; n < ret.length; n++) { long ret_conv_39 = ret[n]; @@ -202,7 +207,7 @@ public class ChannelMonitor extends CommonBase { * appropriately. */ public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - bindings.ChannelMonitor_block_disconnected(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); @@ -218,7 +223,7 @@ public class ChannelMonitor extends CommonBase { * [`block_connected`]: Self::block_connected */ public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length]; for (int n = 0; n < ret.length; n++) { long ret_conv_39 = ret[n]; @@ -241,7 +246,7 @@ public class ChannelMonitor extends CommonBase { * [`block_disconnected`]: Self::block_disconnected */ public void transaction_unconfirmed(byte[] txid, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, txid, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); @@ -257,7 +262,7 @@ public class ChannelMonitor extends CommonBase { * [`block_connected`]: Self::block_connected */ public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length]; for (int n = 0; n < ret.length; n++) { long ret_conv_39 = ret[n]; diff --git a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java index 2f4d00a5..815b2632 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java @@ -55,6 +55,11 @@ public class ChannelMonitorUpdate extends CommonBase { bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val); } + long clone_ptr() { + long ret = bindings.ChannelMonitorUpdate_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelMonitorUpdate */ diff --git a/src/main/java/org/ldk/structs/ChannelPublicKeys.java b/src/main/java/org/ldk/structs/ChannelPublicKeys.java index 2d98499b..fe4c4058 100644 --- a/src/main/java/org/ldk/structs/ChannelPublicKeys.java +++ b/src/main/java/org/ldk/structs/ChannelPublicKeys.java @@ -33,7 +33,7 @@ public class ChannelPublicKeys extends CommonBase { * on-chain channel lock-in 2-of-2 multisig output. */ public void set_funding_pubkey(byte[] val) { - bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, val); + bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -54,7 +54,7 @@ public class ChannelPublicKeys extends CommonBase { * states. */ public void set_revocation_basepoint(byte[] val) { - bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val); + bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -73,7 +73,7 @@ public class ChannelPublicKeys extends CommonBase { * static across every commitment transaction. */ public void set_payment_point(byte[] val) { - bindings.ChannelPublicKeys_set_payment_point(this.ptr, val); + bindings.ChannelPublicKeys_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -92,7 +92,7 @@ public class ChannelPublicKeys extends CommonBase { * after some delay (or can be claimed via the revocation path). */ public void set_delayed_payment_basepoint(byte[] val) { - bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val); + bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -109,20 +109,25 @@ public class ChannelPublicKeys extends CommonBase { * which is used to encumber HTLC-in-flight outputs. */ public void set_htlc_basepoint(byte[] val) { - bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val); + bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** * Constructs a new ChannelPublicKeys given each field */ public static ChannelPublicKeys of(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg) { - long ret = bindings.ChannelPublicKeys_new(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg); + long ret = bindings.ChannelPublicKeys_new(InternalUtils.check_arr_len(funding_pubkey_arg, 33), InternalUtils.check_arr_len(revocation_basepoint_arg, 33), InternalUtils.check_arr_len(payment_point_arg, 33), InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33), InternalUtils.check_arr_len(htlc_basepoint_arg, 33)); if (ret >= 0 && ret <= 4096) { return null; } ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelPublicKeys_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelPublicKeys */ diff --git a/src/main/java/org/ldk/structs/ChannelReestablish.java b/src/main/java/org/ldk/structs/ChannelReestablish.java index cf589693..6e50f617 100644 --- a/src/main/java/org/ldk/structs/ChannelReestablish.java +++ b/src/main/java/org/ldk/structs/ChannelReestablish.java @@ -31,7 +31,7 @@ public class ChannelReestablish extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.ChannelReestablish_set_channel_id(this.ptr, val); + bindings.ChannelReestablish_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -64,6 +64,11 @@ public class ChannelReestablish extends CommonBase { bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val); } + long clone_ptr() { + long ret = bindings.ChannelReestablish_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelReestablish */ diff --git a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java index 3145a4f1..3835ee09 100644 --- a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java @@ -132,6 +132,11 @@ public class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelTransactionParameters_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelTransactionParameters */ diff --git a/src/main/java/org/ldk/structs/ChannelUpdate.java b/src/main/java/org/ldk/structs/ChannelUpdate.java index 1f0f43b1..12f66e65 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelUpdate.java @@ -31,7 +31,7 @@ public class ChannelUpdate extends CommonBase { * A signature of the channel update */ public void set_signature(byte[] val) { - bindings.ChannelUpdate_set_signature(this.ptr, val); + bindings.ChannelUpdate_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** @@ -56,13 +56,18 @@ public class ChannelUpdate extends CommonBase { * Constructs a new ChannelUpdate given each field */ public static ChannelUpdate of(byte[] signature_arg, UnsignedChannelUpdate contents_arg) { - long ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + long ret = bindings.ChannelUpdate_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ChannelUpdate_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ChannelUpdate */ diff --git a/src/main/java/org/ldk/structs/ClosingSigned.java b/src/main/java/org/ldk/structs/ClosingSigned.java index a7fb48ba..a67baf21 100644 --- a/src/main/java/org/ldk/structs/ClosingSigned.java +++ b/src/main/java/org/ldk/structs/ClosingSigned.java @@ -31,7 +31,7 @@ public class ClosingSigned extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.ClosingSigned_set_channel_id(this.ptr, val); + bindings.ClosingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -61,7 +61,7 @@ public class ClosingSigned extends CommonBase { * A signature on the closing transaction */ public void set_signature(byte[] val) { - bindings.ClosingSigned_set_signature(this.ptr, val); + bindings.ClosingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** @@ -93,13 +93,18 @@ public class ClosingSigned extends CommonBase { * Constructs a new ClosingSigned given each field */ public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, ClosingSignedFeeRange fee_range_arg) { - long ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg, fee_range_arg == null ? 0 : fee_range_arg.ptr & ~1); + long ret = bindings.ClosingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), fee_satoshis_arg, InternalUtils.check_arr_len(signature_arg, 64), fee_range_arg == null ? 0 : fee_range_arg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSigned(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ClosingSigned_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ClosingSigned */ diff --git a/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java b/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java index 6f4e79c1..7d17307e 100644 --- a/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java +++ b/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java @@ -66,6 +66,11 @@ public class ClosingSignedFeeRange extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ClosingSignedFeeRange_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ClosingSignedFeeRange */ diff --git a/src/main/java/org/ldk/structs/ClosingTransaction.java b/src/main/java/org/ldk/structs/ClosingTransaction.java index 198d2a48..35de3c83 100644 --- a/src/main/java/org/ldk/structs/ClosingTransaction.java +++ b/src/main/java/org/ldk/structs/ClosingTransaction.java @@ -23,6 +23,11 @@ public class ClosingTransaction extends CommonBase { if (ptr != 0) { bindings.ClosingTransaction_free(ptr); } } + long clone_ptr() { + long ret = bindings.ClosingTransaction_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ClosingTransaction */ diff --git a/src/main/java/org/ldk/structs/ClosureReason.java b/src/main/java/org/ldk/structs/ClosureReason.java index b50f8861..88ac1573 100644 --- a/src/main/java/org/ldk/structs/ClosureReason.java +++ b/src/main/java/org/ldk/structs/ClosureReason.java @@ -44,6 +44,12 @@ public class ClosureReason extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * Closure generated from receiving a peer error message. + * + * Our counterparty may have broadcasted their latest commitment state, and we have + * as well. + */ public final static class CounterpartyForceClosed extends ClosureReason { /** * The error which the peer sent us. @@ -58,21 +64,38 @@ public class ClosureReason extends CommonBase { this.peer_msg = obj.peer_msg; } } + /** + * Closure generated from [`ChannelManager::force_close_channel`], called by the user. + * + * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel. + */ public final static class HolderForceClosed extends ClosureReason { private HolderForceClosed(long ptr, bindings.LDKClosureReason.HolderForceClosed obj) { super(null, ptr); } } + /** + * The channel was closed after negotiating a cooperative close and we've now broadcasted + * the cooperative close transaction. Note the shutdown may have been initiated by us. + */ public final static class CooperativeClosure extends ClosureReason { private CooperativeClosure(long ptr, bindings.LDKClosureReason.CooperativeClosure obj) { super(null, ptr); } } + /** + * A commitment transaction was confirmed on chain, closing the channel. Most likely this + * commitment transaction came from our counterparty, but it may also have come from + * a copy of our own `ChannelMonitor`. + */ public final static class CommitmentTxConfirmed extends ClosureReason { private CommitmentTxConfirmed(long ptr, bindings.LDKClosureReason.CommitmentTxConfirmed obj) { super(null, ptr); } } + /** + * Closure generated from processing an event, likely a HTLC forward/relay/reception. + */ public final static class ProcessingError extends ClosureReason { /** * A developer-readable error message which we generated. @@ -83,16 +106,32 @@ public class ClosureReason extends CommonBase { this.err = obj.err; } } + /** + * The `PeerManager` informed us that we've disconnected from the peer. We close channels + * if the `PeerManager` informed us that it is unlikely we'll be able to connect to the + * peer again in the future or if the peer disconnected before we finished negotiating + * the channel open. The first case may be caused by incompatible features which our + * counterparty, or we, require. + */ public final static class DisconnectedPeer extends ClosureReason { private DisconnectedPeer(long ptr, bindings.LDKClosureReason.DisconnectedPeer obj) { super(null, ptr); } } + /** + * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than + * the ChannelManager deserialized. + */ public final static class OutdatedChannelManager extends ClosureReason { private OutdatedChannelManager(long ptr, bindings.LDKClosureReason.OutdatedChannelManager obj) { super(null, ptr); } } + long clone_ptr() { + long ret = bindings.ClosureReason_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ClosureReason */ diff --git a/src/main/java/org/ldk/structs/CommitmentSigned.java b/src/main/java/org/ldk/structs/CommitmentSigned.java index 85266a6e..adce70a4 100644 --- a/src/main/java/org/ldk/structs/CommitmentSigned.java +++ b/src/main/java/org/ldk/structs/CommitmentSigned.java @@ -31,7 +31,7 @@ public class CommitmentSigned extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.CommitmentSigned_set_channel_id(this.ptr, val); + bindings.CommitmentSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -46,27 +46,32 @@ public class CommitmentSigned extends CommonBase { * A signature on the commitment transaction */ public void set_signature(byte[] val) { - bindings.CommitmentSigned_set_signature(this.ptr, val); + bindings.CommitmentSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** * Signatures on the HTLC transactions */ public void set_htlc_signatures(byte[][] val) { - bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val); + bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val != null ? Arrays.stream(val).map(val_conv_8 -> InternalUtils.check_arr_len(val_conv_8, 64)).toArray(byte[][]::new) : null); } /** * Constructs a new CommitmentSigned given each field */ public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) { - long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg); + long ret = bindings.CommitmentSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64), htlc_signatures_arg != null ? Arrays.stream(htlc_signatures_arg).map(htlc_signatures_arg_conv_8 -> InternalUtils.check_arr_len(htlc_signatures_arg_conv_8, 64)).toArray(byte[][]::new) : null); if (ret >= 0 && ret <= 4096) { return null; } CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.CommitmentSigned_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the CommitmentSigned */ diff --git a/src/main/java/org/ldk/structs/CommitmentTransaction.java b/src/main/java/org/ldk/structs/CommitmentTransaction.java index 276a69d0..b4dda525 100644 --- a/src/main/java/org/ldk/structs/CommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/CommitmentTransaction.java @@ -24,6 +24,11 @@ public class CommitmentTransaction extends CommonBase { if (ptr != 0) { bindings.CommitmentTransaction_free(ptr); } } + long clone_ptr() { + long ret = bindings.CommitmentTransaction_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the CommitmentTransaction */ diff --git a/src/main/java/org/ldk/structs/CommitmentUpdate.java b/src/main/java/org/ldk/structs/CommitmentUpdate.java index fe5bcf0c..8b8e32dd 100644 --- a/src/main/java/org/ldk/structs/CommitmentUpdate.java +++ b/src/main/java/org/ldk/structs/CommitmentUpdate.java @@ -160,6 +160,11 @@ public class CommitmentUpdate extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.CommitmentUpdate_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the CommitmentUpdate */ diff --git a/src/main/java/org/ldk/structs/Confirm.java b/src/main/java/org/ldk/structs/Confirm.java index 6f1ab544..bfa6bbe6 100644 --- a/src/main/java/org/ldk/structs/Confirm.java +++ b/src/main/java/org/ldk/structs/Confirm.java @@ -128,7 +128,8 @@ public class Confirm extends CommonBase { } @Override public byte[][] get_relevant_txids() { byte[][] ret = arg.get_relevant_txids(); - return ret; + byte[][] result = ret != null ? Arrays.stream(ret).map(ret_conv_8 -> InternalUtils.check_arr_len(ret_conv_8, 32)).toArray(byte[][]::new) : null; + return result; } }); return impl_holder.held; @@ -149,7 +150,7 @@ public class Confirm extends CommonBase { * [`best_block_updated`]: Self::best_block_updated */ public void transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height) { - bindings.Confirm_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height); + bindings.Confirm_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height); } /** @@ -163,7 +164,7 @@ public class Confirm extends CommonBase { * [`transactions_confirmed`]: Self::transactions_confirmed */ public void transaction_unconfirmed(byte[] txid) { - bindings.Confirm_transaction_unconfirmed(this.ptr, txid); + bindings.Confirm_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32)); } /** @@ -173,7 +174,7 @@ public class Confirm extends CommonBase { * if they become available at the same time. */ public void best_block_updated(byte[] header, int height) { - bindings.Confirm_best_block_updated(this.ptr, header, height); + bindings.Confirm_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height); } /** diff --git a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java index 52ccf569..e4317035 100644 --- a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java @@ -63,6 +63,11 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.CounterpartyChannelTransactionParameters_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the CounterpartyChannelTransactionParameters */ diff --git a/src/main/java/org/ldk/structs/CounterpartyForwardingInfo.java b/src/main/java/org/ldk/structs/CounterpartyForwardingInfo.java index 7912abfe..cfd35f4f 100644 --- a/src/main/java/org/ldk/structs/CounterpartyForwardingInfo.java +++ b/src/main/java/org/ldk/structs/CounterpartyForwardingInfo.java @@ -79,6 +79,11 @@ public class CounterpartyForwardingInfo extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.CounterpartyForwardingInfo_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the CounterpartyForwardingInfo */ diff --git a/src/main/java/org/ldk/structs/CustomMessageHandler.java b/src/main/java/org/ldk/structs/CustomMessageHandler.java index 81a32f93..06354d6a 100644 --- a/src/main/java/org/ldk/structs/CustomMessageHandler.java +++ b/src/main/java/org/ldk/structs/CustomMessageHandler.java @@ -46,12 +46,12 @@ public class CustomMessageHandler extends CommonBase { Type ret_hu_conv = new Type(null, msg); ret_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_custom_message(ret_hu_conv, sender_node_id); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long[] get_and_clear_pending_msg() { TwoTuple_PublicKeyTypeZ[] ret = arg.get_and_clear_pending_msg(); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_25 -> ret_conv_25 != null ? ret_conv_25.ptr : 0).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_25 -> ret_conv_25 == null ? 0 : ret_conv_25.clone_ptr()).toArray() : null; return result; } }, CustomMessageReader.new_impl(CustomMessageReader_impl).bindings_instance); @@ -72,7 +72,7 @@ public class CustomMessageHandler extends CommonBase { * Can return a `MessageHandlingError` if the message could not be handled. */ public Result_NoneLightningErrorZ handle_custom_message(Type msg, byte[] sender_node_id) { - long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, sender_node_id); + long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33)); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); diff --git a/src/main/java/org/ldk/structs/CustomMessageReader.java b/src/main/java/org/ldk/structs/CustomMessageReader.java index 792dbb88..816d3783 100644 --- a/src/main/java/org/ldk/structs/CustomMessageReader.java +++ b/src/main/java/org/ldk/structs/CustomMessageReader.java @@ -39,7 +39,7 @@ public class CustomMessageReader extends CommonBase { impl_holder.held = new CustomMessageReader(new bindings.LDKCustomMessageReader() { @Override public long read(short message_type, byte[] buffer) { Result_COption_TypeZDecodeErrorZ ret = arg.read(message_type, buffer); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }); diff --git a/src/main/java/org/ldk/structs/DataLossProtect.java b/src/main/java/org/ldk/structs/DataLossProtect.java index 70b3f3e1..2b36e90a 100644 --- a/src/main/java/org/ldk/structs/DataLossProtect.java +++ b/src/main/java/org/ldk/structs/DataLossProtect.java @@ -36,7 +36,7 @@ public class DataLossProtect extends CommonBase { * belonging to the recipient */ public void set_your_last_per_commitment_secret(byte[] val) { - bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, val); + bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -51,20 +51,25 @@ public class DataLossProtect extends CommonBase { * The sender's per-commitment point for their current commitment transaction */ public void set_my_current_per_commitment_point(byte[] val) { - bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, val); + bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** * Constructs a new DataLossProtect given each field */ public static DataLossProtect of(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) { - long ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg); + long ret = bindings.DataLossProtect_new(InternalUtils.check_arr_len(your_last_per_commitment_secret_arg, 32), InternalUtils.check_arr_len(my_current_per_commitment_point_arg, 33)); if (ret >= 0 && ret <= 4096) { return null; } DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DataLossProtect(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.DataLossProtect_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the DataLossProtect */ diff --git a/src/main/java/org/ldk/structs/DecodeError.java b/src/main/java/org/ldk/structs/DecodeError.java index 5f7d8809..64206c55 100644 --- a/src/main/java/org/ldk/structs/DecodeError.java +++ b/src/main/java/org/ldk/structs/DecodeError.java @@ -19,6 +19,11 @@ public class DecodeError extends CommonBase { if (ptr != 0) { bindings.DecodeError_free(ptr); } } + long clone_ptr() { + long ret = bindings.DecodeError_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the DecodeError */ diff --git a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java index c0b84328..a8ddbf3f 100644 --- a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java @@ -50,7 +50,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { * Per commitment point to derive delayed_payment_key by key holder */ public void set_per_commitment_point(byte[] val) { - bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, val); + bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -91,7 +91,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { * derive the witnessScript for this output. */ public void set_revocation_pubkey(byte[] val) { - bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val); + bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -110,7 +110,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { * the channel to spend the output. */ public void set_channel_keys_id(byte[] val) { - bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val); + bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -132,13 +132,18 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { * Constructs a new DelayedPaymentOutputDescriptor given each field */ public static DelayedPaymentOutputDescriptor of(OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, TxOut output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { - long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, per_commitment_point_arg, to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg, channel_keys_id_arg, channel_value_satoshis_arg); + long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, InternalUtils.check_arr_len(per_commitment_point_arg, 33), to_self_delay_arg, output_arg.ptr, InternalUtils.check_arr_len(revocation_pubkey_arg, 33), InternalUtils.check_arr_len(channel_keys_id_arg, 32), channel_value_satoshis_arg); if (ret >= 0 && ret <= 4096) { return null; } DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.DelayedPaymentOutputDescriptor_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the DelayedPaymentOutputDescriptor */ diff --git a/src/main/java/org/ldk/structs/Description.java b/src/main/java/org/ldk/structs/Description.java index 707fff23..8e8f68ff 100644 --- a/src/main/java/org/ldk/structs/Description.java +++ b/src/main/java/org/ldk/structs/Description.java @@ -22,6 +22,11 @@ public class Description extends CommonBase { if (ptr != 0) { bindings.Description_free(ptr); } } + long clone_ptr() { + long ret = bindings.Description_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Description */ diff --git a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java index d90c4fc5..55da7871 100644 --- a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java @@ -158,6 +158,11 @@ public class DirectionalChannelInfo extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.DirectionalChannelInfo_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the DirectionalChannelInfo */ diff --git a/src/main/java/org/ldk/structs/ErrorAction.java b/src/main/java/org/ldk/structs/ErrorAction.java index c13b9e51..ec2ae18f 100644 --- a/src/main/java/org/ldk/structs/ErrorAction.java +++ b/src/main/java/org/ldk/structs/ErrorAction.java @@ -35,6 +35,9 @@ public class ErrorAction extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * The peer took some action which made us think they were useless. Disconnect them. + */ public final static class DisconnectPeer extends ErrorAction { /** * An error message which we should make an effort to send before we disconnect. @@ -50,11 +53,18 @@ public class ErrorAction extends CommonBase { this.msg = msg_hu_conv; } } + /** + * The peer did something harmless that we weren't able to process, just log and ignore + */ public final static class IgnoreError extends ErrorAction { private IgnoreError(long ptr, bindings.LDKErrorAction.IgnoreError obj) { super(null, ptr); } } + /** + * The peer did something harmless that we weren't able to meaningfully process. + * If the error is logged, log it at the given level. + */ public final static class IgnoreAndLog extends ErrorAction { public final Level ignore_and_log; private IgnoreAndLog(long ptr, bindings.LDKErrorAction.IgnoreAndLog obj) { @@ -62,6 +72,9 @@ public class ErrorAction extends CommonBase { this.ignore_and_log = obj.ignore_and_log; } } + /** + * The peer did something incorrect. Tell them. + */ public final static class SendErrorMessage extends ErrorAction { /** * The message to send. @@ -75,6 +88,11 @@ public class ErrorAction extends CommonBase { this.msg = msg_hu_conv; } } + long clone_ptr() { + long ret = bindings.ErrorAction_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ErrorAction */ diff --git a/src/main/java/org/ldk/structs/ErrorMessage.java b/src/main/java/org/ldk/structs/ErrorMessage.java index 1fcb6d25..cf7b9f50 100644 --- a/src/main/java/org/ldk/structs/ErrorMessage.java +++ b/src/main/java/org/ldk/structs/ErrorMessage.java @@ -31,7 +31,7 @@ public class ErrorMessage extends CommonBase { * The channel ID involved in the error */ public void set_channel_id(byte[] val) { - bindings.ErrorMessage_set_channel_id(this.ptr, val); + bindings.ErrorMessage_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -59,13 +59,18 @@ public class ErrorMessage extends CommonBase { * Constructs a new ErrorMessage given each field */ public static ErrorMessage of(byte[] channel_id_arg, java.lang.String data_arg) { - long ret = bindings.ErrorMessage_new(channel_id_arg, data_arg); + long ret = bindings.ErrorMessage_new(InternalUtils.check_arr_len(channel_id_arg, 32), data_arg); if (ret >= 0 && ret <= 4096) { return null; } ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ErrorMessage(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ErrorMessage_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ErrorMessage */ diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index d3f85fed..06124414 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -54,6 +54,13 @@ public class Event extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * Used to indicate that the client should generate a funding transaction with the given + * parameters and then call ChannelManager::funding_transaction_generated. + * Generated in ChannelManager message handling. + * Note that *all inputs* in the funding transaction must spend SegWit outputs or your + * counterparty can steal your funds! + */ public final static class FundingGenerationReady extends Event { /** * The random channel_id we picked which you'll need to pass into @@ -83,6 +90,19 @@ public class Event extends CommonBase { this.user_channel_id = obj.user_channel_id; } } + /** + * Indicates we've received money! Just gotta dig out that payment preimage and feed it to + * [`ChannelManager::claim_funds`] to get it.... + * Note that if the preimage is not known, you should call + * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid + * network congestion. + * If you fail to call either [`ChannelManager::claim_funds`] or + * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be + * automatically failed. + * + * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds + * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards + */ public final static class PaymentReceived extends Event { /** * The hash for which the preimage should be handed to the ChannelManager. @@ -107,6 +127,13 @@ public class Event extends CommonBase { this.purpose = purpose_hu_conv; } } + /** + * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target + * and we got back the payment preimage for it). + * + * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed` + * event. In this situation, you SHOULD treat this payment as having succeeded. + */ public final static class PaymentSent extends Event { /** * The id returned by [`ChannelManager::send_payment`] and used with @@ -153,6 +180,10 @@ public class Event extends CommonBase { this.fee_paid_msat = fee_paid_msat_hu_conv; } } + /** + * Indicates an outbound payment we made failed. Probably some intermediary node dropped + * something. You may wish to retry with a different route. + */ public final static class PaymentPathFailed extends Event { /** * The id returned by [`ChannelManager::send_payment`] and used with @@ -242,6 +273,10 @@ public class Event extends CommonBase { this.retry = retry_hu_conv; } } + /** + * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a + * time in the future. + */ public final static class PendingHTLCsForwardable extends Event { /** * The minimum amount of time that should be waited prior to calling @@ -255,6 +290,13 @@ public class Event extends CommonBase { this.time_forwardable = obj.time_forwardable; } } + /** + * Used to indicate that an output which you should know how to spend was confirmed on chain + * and is now spendable. + * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your + * counterparty spending them due to some kind of timeout. Thus, you need to store them + * somewhere and spend them when you create on-chain transactions. + */ public final static class SpendableOutputs extends Event { /** * The outputs which you should store as spendable by you. @@ -273,6 +315,10 @@ public class Event extends CommonBase { this.outputs = outputs_conv_27_arr; } } + /** + * This event is generated when a payment has been successfully forwarded through us and a + * forwarding fee earned. + */ public final static class PaymentForwarded extends Event { /** * The fee, in milli-satoshis, which was earned as a result of the payment. @@ -304,6 +350,9 @@ public class Event extends CommonBase { this.claim_from_onchain_tx = obj.claim_from_onchain_tx; } } + /** + * Used to indicate that a channel with the given `channel_id` is in the process of closure. + */ public final static class ChannelClosed extends Event { /** * The channel_id of the channel which has been closed. Note that on-chain transactions @@ -332,6 +381,10 @@ public class Event extends CommonBase { this.reason = reason_hu_conv; } } + /** + * Used to indicate to the user that they can abandon the funding transaction and recycle the + * inputs for another purpose. + */ public final static class DiscardFunding extends Event { /** * The channel_id of the channel which has been closed. @@ -347,6 +400,11 @@ public class Event extends CommonBase { this.transaction = obj.transaction; } } + long clone_ptr() { + long ret = bindings.Event_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Event */ @@ -362,7 +420,7 @@ public class Event extends CommonBase { * Utility method to constructs a new FundingGenerationReady-variant Event */ public static Event funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { - long ret = bindings.Event_funding_generation_ready(temporary_channel_id, channel_value_satoshis, output_script, user_channel_id); + long ret = bindings.Event_funding_generation_ready(InternalUtils.check_arr_len(temporary_channel_id, 32), channel_value_satoshis, output_script, user_channel_id); if (ret >= 0 && ret <= 4096) { return null; } Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -373,7 +431,7 @@ public class Event extends CommonBase { * Utility method to constructs a new PaymentReceived-variant Event */ public static Event payment_received(byte[] payment_hash, long amt, PaymentPurpose purpose) { - long ret = bindings.Event_payment_received(payment_hash, amt, purpose.ptr); + long ret = bindings.Event_payment_received(InternalUtils.check_arr_len(payment_hash, 32), amt, purpose.ptr); if (ret >= 0 && ret <= 4096) { return null; } Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -384,7 +442,7 @@ public class Event extends CommonBase { * Utility method to constructs a new PaymentSent-variant Event */ public static Event payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, Option_u64Z fee_paid_msat) { - long ret = bindings.Event_payment_sent(payment_id, payment_preimage, payment_hash, fee_paid_msat.ptr); + long ret = bindings.Event_payment_sent(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_hash, 32), fee_paid_msat.ptr); if (ret >= 0 && ret <= 4096) { return null; } Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -395,7 +453,7 @@ public class Event extends CommonBase { * Utility method to constructs a new PaymentPathFailed-variant Event */ public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) { - long ret = bindings.Event_payment_path_failed(payment_id, payment_hash, rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1); + long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -439,7 +497,7 @@ public class Event extends CommonBase { * Utility method to constructs a new ChannelClosed-variant Event */ public static Event channel_closed(byte[] channel_id, long user_channel_id, ClosureReason reason) { - long ret = bindings.Event_channel_closed(channel_id, user_channel_id, reason.ptr); + long ret = bindings.Event_channel_closed(InternalUtils.check_arr_len(channel_id, 32), user_channel_id, reason.ptr); if (ret >= 0 && ret <= 4096) { return null; } Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -450,7 +508,7 @@ public class Event extends CommonBase { * Utility method to constructs a new DiscardFunding-variant Event */ public static Event discard_funding(byte[] channel_id, byte[] transaction) { - long ret = bindings.Event_discard_funding(channel_id, transaction); + long ret = bindings.Event_discard_funding(InternalUtils.check_arr_len(channel_id, 32), transaction); if (ret >= 0 && ret <= 4096) { return null; } Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/ExpiryTime.java b/src/main/java/org/ldk/structs/ExpiryTime.java index 60c7a2e0..c476b6c6 100644 --- a/src/main/java/org/ldk/structs/ExpiryTime.java +++ b/src/main/java/org/ldk/structs/ExpiryTime.java @@ -25,6 +25,11 @@ public class ExpiryTime extends CommonBase { if (ptr != 0) { bindings.ExpiryTime_free(ptr); } } + long clone_ptr() { + long ret = bindings.ExpiryTime_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ExpiryTime */ diff --git a/src/main/java/org/ldk/structs/Fallback.java b/src/main/java/org/ldk/structs/Fallback.java index 3e687e7c..c82d85c1 100644 --- a/src/main/java/org/ldk/structs/Fallback.java +++ b/src/main/java/org/ldk/structs/Fallback.java @@ -57,6 +57,11 @@ public class Fallback extends CommonBase { this.script_hash = obj.script_hash; } } + long clone_ptr() { + long ret = bindings.Fallback_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Fallback */ @@ -83,7 +88,7 @@ public class Fallback extends CommonBase { * Utility method to constructs a new PubKeyHash-variant Fallback */ public static Fallback pub_key_hash(byte[] a) { - long ret = bindings.Fallback_pub_key_hash(a); + long ret = bindings.Fallback_pub_key_hash(InternalUtils.check_arr_len(a, 20)); if (ret >= 0 && ret <= 4096) { return null; } Fallback ret_hu_conv = Fallback.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -94,7 +99,7 @@ public class Fallback extends CommonBase { * Utility method to constructs a new ScriptHash-variant Fallback */ public static Fallback script_hash(byte[] a) { - long ret = bindings.Fallback_script_hash(a); + long ret = bindings.Fallback_script_hash(InternalUtils.check_arr_len(a, 20)); if (ret >= 0 && ret <= 4096) { return null; } Fallback ret_hu_conv = Fallback.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/Filter.java b/src/main/java/org/ldk/structs/Filter.java index f93f321d..764f2cbb 100644 --- a/src/main/java/org/ldk/structs/Filter.java +++ b/src/main/java/org/ldk/structs/Filter.java @@ -72,7 +72,7 @@ public class Filter extends CommonBase { WatchedOutput output_hu_conv = null; if (output < 0 || output > 4096) { output_hu_conv = new WatchedOutput(null, output); } output_hu_conv.ptrs_to.add(this); Option_C2Tuple_usizeTransactionZZ ret = arg.register_output(output_hu_conv); - long result = ret.ptr; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }); @@ -83,7 +83,7 @@ public class Filter extends CommonBase { * a spending condition. */ public void register_tx(byte[] txid, byte[] script_pubkey) { - bindings.Filter_register_tx(this.ptr, txid, script_pubkey); + bindings.Filter_register_tx(this.ptr, InternalUtils.check_arr_len(txid, 32), script_pubkey); } /** diff --git a/src/main/java/org/ldk/structs/FundingCreated.java b/src/main/java/org/ldk/structs/FundingCreated.java index 0585d27a..ce30b15f 100644 --- a/src/main/java/org/ldk/structs/FundingCreated.java +++ b/src/main/java/org/ldk/structs/FundingCreated.java @@ -31,7 +31,7 @@ public class FundingCreated extends CommonBase { * A temporary channel ID, until the funding is established */ public void set_temporary_channel_id(byte[] val) { - bindings.FundingCreated_set_temporary_channel_id(this.ptr, val); + bindings.FundingCreated_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -46,7 +46,7 @@ public class FundingCreated extends CommonBase { * The funding transaction ID */ public void set_funding_txid(byte[] val) { - bindings.FundingCreated_set_funding_txid(this.ptr, val); + bindings.FundingCreated_set_funding_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -76,20 +76,25 @@ public class FundingCreated extends CommonBase { * The signature of the channel initiator (funder) on the initial commitment transaction */ public void set_signature(byte[] val) { - bindings.FundingCreated_set_signature(this.ptr, val); + bindings.FundingCreated_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** * Constructs a new FundingCreated given each field */ public static FundingCreated of(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) { - long ret = bindings.FundingCreated_new(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg); + long ret = bindings.FundingCreated_new(InternalUtils.check_arr_len(temporary_channel_id_arg, 32), InternalUtils.check_arr_len(funding_txid_arg, 32), funding_output_index_arg, InternalUtils.check_arr_len(signature_arg, 64)); if (ret >= 0 && ret <= 4096) { return null; } FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.FundingCreated_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the FundingCreated */ diff --git a/src/main/java/org/ldk/structs/FundingLocked.java b/src/main/java/org/ldk/structs/FundingLocked.java index b5f9b1e2..4aa45f98 100644 --- a/src/main/java/org/ldk/structs/FundingLocked.java +++ b/src/main/java/org/ldk/structs/FundingLocked.java @@ -31,7 +31,7 @@ public class FundingLocked extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.FundingLocked_set_channel_id(this.ptr, val); + bindings.FundingLocked_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -46,20 +46,25 @@ public class FundingLocked extends CommonBase { * The per-commitment point of the second commitment transaction */ public void set_next_per_commitment_point(byte[] val) { - bindings.FundingLocked_set_next_per_commitment_point(this.ptr, val); + bindings.FundingLocked_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** * Constructs a new FundingLocked given each field */ public static FundingLocked of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg) { - long ret = bindings.FundingLocked_new(channel_id_arg, next_per_commitment_point_arg); + long ret = bindings.FundingLocked_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33)); if (ret >= 0 && ret <= 4096) { return null; } FundingLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingLocked(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.FundingLocked_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the FundingLocked */ diff --git a/src/main/java/org/ldk/structs/FundingSigned.java b/src/main/java/org/ldk/structs/FundingSigned.java index b56363bc..e612f54f 100644 --- a/src/main/java/org/ldk/structs/FundingSigned.java +++ b/src/main/java/org/ldk/structs/FundingSigned.java @@ -31,7 +31,7 @@ public class FundingSigned extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.FundingSigned_set_channel_id(this.ptr, val); + bindings.FundingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -46,20 +46,25 @@ public class FundingSigned extends CommonBase { * The signature of the channel acceptor (fundee) on the initial commitment transaction */ public void set_signature(byte[] val) { - bindings.FundingSigned_set_signature(this.ptr, val); + bindings.FundingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** * Constructs a new FundingSigned given each field */ public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) { - long ret = bindings.FundingSigned_new(channel_id_arg, signature_arg); + long ret = bindings.FundingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64)); if (ret >= 0 && ret <= 4096) { return null; } FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingSigned(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.FundingSigned_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the FundingSigned */ diff --git a/src/main/java/org/ldk/structs/GossipTimestampFilter.java b/src/main/java/org/ldk/structs/GossipTimestampFilter.java index 2693985b..0e35356b 100644 --- a/src/main/java/org/ldk/structs/GossipTimestampFilter.java +++ b/src/main/java/org/ldk/structs/GossipTimestampFilter.java @@ -33,7 +33,7 @@ public class GossipTimestampFilter extends CommonBase { * The genesis hash of the blockchain for channel and node information */ public void set_chain_hash(byte[] val) { - bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val); + bindings.GossipTimestampFilter_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -70,13 +70,18 @@ public class GossipTimestampFilter extends CommonBase { * Constructs a new GossipTimestampFilter given each field */ public static GossipTimestampFilter of(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) { - long ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg); + long ret = bindings.GossipTimestampFilter_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_timestamp_arg, timestamp_range_arg); if (ret >= 0 && ret <= 4096) { return null; } GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new GossipTimestampFilter(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.GossipTimestampFilter_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the GossipTimestampFilter */ diff --git a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java index 55f2cb22..9eff5b40 100644 --- a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java +++ b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java @@ -84,7 +84,7 @@ public class HTLCOutputInCommitment extends CommonBase { * The hash of the preimage which unlocks this HTLC. */ public void set_payment_hash(byte[] val) { - bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); + bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -113,13 +113,18 @@ public class HTLCOutputInCommitment extends CommonBase { * Constructs a new HTLCOutputInCommitment given each field */ public static HTLCOutputInCommitment of(boolean offered_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, Option_u32Z transaction_output_index_arg) { - long ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg, transaction_output_index_arg.ptr); + long ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, InternalUtils.check_arr_len(payment_hash_arg, 32), transaction_output_index_arg.ptr); if (ret >= 0 && ret <= 4096) { return null; } HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HTLCOutputInCommitment(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.HTLCOutputInCommitment_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the HTLCOutputInCommitment */ diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index 8831420b..c15590f4 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -21,6 +21,11 @@ public class HTLCUpdate extends CommonBase { if (ptr != 0) { bindings.HTLCUpdate_free(ptr); } } + long clone_ptr() { + long ret = bindings.HTLCUpdate_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the HTLCUpdate */ diff --git a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java index 5e326201..23716acf 100644 --- a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java @@ -33,14 +33,19 @@ public class HolderCommitmentTransaction extends CommonBase { * Our counterparty's signature for the transaction */ public void set_counterparty_sig(byte[] val) { - bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, val); + bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** * All non-dust counterparty HTLC signatures, in the order they appear in the transaction */ public void set_counterparty_htlc_sigs(byte[][] val) { - bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val); + bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val != null ? Arrays.stream(val).map(val_conv_8 -> InternalUtils.check_arr_len(val_conv_8, 64)).toArray(byte[][]::new) : null); + } + + long clone_ptr() { + long ret = bindings.HolderCommitmentTransaction_clone_ptr(this.ptr); + return ret; } /** @@ -77,7 +82,7 @@ public class HolderCommitmentTransaction extends CommonBase { * The funding keys are used to figure out which signature should go first when building the transaction for broadcast. */ public static HolderCommitmentTransaction of(CommitmentTransaction commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key) { - long ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key); + long ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, InternalUtils.check_arr_len(counterparty_sig, 64), counterparty_htlc_sigs != null ? Arrays.stream(counterparty_htlc_sigs).map(counterparty_htlc_sigs_conv_8 -> InternalUtils.check_arr_len(counterparty_htlc_sigs_conv_8, 64)).toArray(byte[][]::new) : null, InternalUtils.check_arr_len(holder_funding_key, 33), InternalUtils.check_arr_len(counterparty_funding_key, 33)); if (ret >= 0 && ret <= 4096) { return null; } HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HolderCommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/InMemorySigner.java b/src/main/java/org/ldk/structs/InMemorySigner.java index cdfc34ad..5b4b67bc 100644 --- a/src/main/java/org/ldk/structs/InMemorySigner.java +++ b/src/main/java/org/ldk/structs/InMemorySigner.java @@ -34,7 +34,7 @@ public class InMemorySigner extends CommonBase { * Private key of anchor tx */ public void set_funding_key(byte[] val) { - bindings.InMemorySigner_set_funding_key(this.ptr, val); + bindings.InMemorySigner_set_funding_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -49,7 +49,7 @@ public class InMemorySigner extends CommonBase { * Holder secret key for blinded revocation pubkey */ public void set_revocation_base_key(byte[] val) { - bindings.InMemorySigner_set_revocation_base_key(this.ptr, val); + bindings.InMemorySigner_set_revocation_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -64,7 +64,7 @@ public class InMemorySigner extends CommonBase { * Holder secret key used for our balance in counterparty-broadcasted commitment transactions */ public void set_payment_key(byte[] val) { - bindings.InMemorySigner_set_payment_key(this.ptr, val); + bindings.InMemorySigner_set_payment_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -79,7 +79,7 @@ public class InMemorySigner extends CommonBase { * Holder secret key used in HTLC tx */ public void set_delayed_payment_base_key(byte[] val) { - bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, val); + bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -94,7 +94,7 @@ public class InMemorySigner extends CommonBase { * Holder htlc secret key used in commitment tx htlc outputs */ public void set_htlc_base_key(byte[] val) { - bindings.InMemorySigner_set_htlc_base_key(this.ptr, val); + bindings.InMemorySigner_set_htlc_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -109,7 +109,12 @@ public class InMemorySigner extends CommonBase { * Commitment seed */ public void set_commitment_seed(byte[] val) { - bindings.InMemorySigner_set_commitment_seed(this.ptr, val); + bindings.InMemorySigner_set_commitment_seed(this.ptr, InternalUtils.check_arr_len(val, 32)); + } + + long clone_ptr() { + long ret = bindings.InMemorySigner_clone_ptr(this.ptr); + return ret; } /** @@ -127,7 +132,7 @@ public class InMemorySigner extends CommonBase { * Create a new InMemorySigner */ public static InMemorySigner of(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id) { - long ret = bindings.InMemorySigner_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, channel_keys_id); + long ret = bindings.InMemorySigner_new(InternalUtils.check_arr_len(funding_key, 32), InternalUtils.check_arr_len(revocation_base_key, 32), InternalUtils.check_arr_len(payment_key, 32), InternalUtils.check_arr_len(delayed_payment_base_key, 32), InternalUtils.check_arr_len(htlc_base_key, 32), InternalUtils.check_arr_len(commitment_seed, 32), channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32)); if (ret >= 0 && ret <= 4096) { return null; } InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/Init.java b/src/main/java/org/ldk/structs/Init.java index 69f97fa9..c108fd98 100644 --- a/src/main/java/org/ldk/structs/Init.java +++ b/src/main/java/org/ldk/structs/Init.java @@ -48,6 +48,11 @@ public class Init extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.Init_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Init */ diff --git a/src/main/java/org/ldk/structs/InitFeatures.java b/src/main/java/org/ldk/structs/InitFeatures.java index d8ead50a..cdc9a58b 100644 --- a/src/main/java/org/ldk/structs/InitFeatures.java +++ b/src/main/java/org/ldk/structs/InitFeatures.java @@ -30,6 +30,11 @@ public class InitFeatures extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.InitFeatures_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the InitFeatures */ diff --git a/src/main/java/org/ldk/structs/InvalidShutdownScript.java b/src/main/java/org/ldk/structs/InvalidShutdownScript.java index abea7e80..89b502bc 100644 --- a/src/main/java/org/ldk/structs/InvalidShutdownScript.java +++ b/src/main/java/org/ldk/structs/InvalidShutdownScript.java @@ -49,6 +49,11 @@ public class InvalidShutdownScript extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.InvalidShutdownScript_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the InvalidShutdownScript */ diff --git a/src/main/java/org/ldk/structs/Invoice.java b/src/main/java/org/ldk/structs/Invoice.java index 968b221a..8817ed41 100644 --- a/src/main/java/org/ldk/structs/Invoice.java +++ b/src/main/java/org/ldk/structs/Invoice.java @@ -35,6 +35,11 @@ public class Invoice extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.Invoice_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Invoice */ diff --git a/src/main/java/org/ldk/structs/InvoiceFeatures.java b/src/main/java/org/ldk/structs/InvoiceFeatures.java index ccbf4f52..6d075ce9 100644 --- a/src/main/java/org/ldk/structs/InvoiceFeatures.java +++ b/src/main/java/org/ldk/structs/InvoiceFeatures.java @@ -30,6 +30,11 @@ public class InvoiceFeatures extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.InvoiceFeatures_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the InvoiceFeatures */ diff --git a/src/main/java/org/ldk/structs/InvoicePayer.java b/src/main/java/org/ldk/structs/InvoicePayer.java index 4c6d63f0..a54ee10b 100644 --- a/src/main/java/org/ldk/structs/InvoicePayer.java +++ b/src/main/java/org/ldk/structs/InvoicePayer.java @@ -76,7 +76,7 @@ public class InvoicePayer extends CommonBase { * [`EventHandler`]. Otherwise, calling this method is unnecessary. */ public void remove_cached_payment(byte[] payment_hash) { - bindings.InvoicePayer_remove_cached_payment(this.ptr, payment_hash); + bindings.InvoicePayer_remove_cached_payment(this.ptr, InternalUtils.check_arr_len(payment_hash, 32)); } /** diff --git a/src/main/java/org/ldk/structs/InvoiceSignature.java b/src/main/java/org/ldk/structs/InvoiceSignature.java index 8ff00fc6..c6f75910 100644 --- a/src/main/java/org/ldk/structs/InvoiceSignature.java +++ b/src/main/java/org/ldk/structs/InvoiceSignature.java @@ -19,6 +19,11 @@ public class InvoiceSignature extends CommonBase { if (ptr != 0) { bindings.InvoiceSignature_free(ptr); } } + long clone_ptr() { + long ret = bindings.InvoiceSignature_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the InvoiceSignature */ diff --git a/src/main/java/org/ldk/structs/KeysInterface.java b/src/main/java/org/ldk/structs/KeysInterface.java index ea88ec2c..e4c8e486 100644 --- a/src/main/java/org/ldk/structs/KeysInterface.java +++ b/src/main/java/org/ldk/structs/KeysInterface.java @@ -82,7 +82,8 @@ public class KeysInterface extends CommonBase { impl_holder.held = new KeysInterface(new bindings.LDKKeysInterface() { @Override public byte[] get_node_secret() { byte[] ret = arg.get_node_secret(); - return ret; + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; } @Override public byte[] get_destination_script() { byte[] ret = arg.get_destination_script(); @@ -90,27 +91,28 @@ public class KeysInterface extends CommonBase { } @Override public long get_shutdown_scriptpubkey() { ShutdownScript ret = arg.get_shutdown_scriptpubkey(); - long result = ret == null ? 0 : ret.ptr & ~1; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long get_channel_signer(boolean inbound, long channel_value_satoshis) { Sign ret = arg.get_channel_signer(inbound, channel_value_satoshis); - long result = ret == null ? 0 : ret.ptr; + long result = ret == null ? 0 : ret.clone_ptr(); impl_holder.held.ptrs_to.add(ret); return result; } @Override public byte[] get_secure_random_bytes() { byte[] ret = arg.get_secure_random_bytes(); - return ret; + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; } @Override public long read_chan_signer(byte[] reader) { Result_SignDecodeErrorZ ret = arg.read_chan_signer(reader); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_invoice(byte[] invoice_preimage) { Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(invoice_preimage); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }); diff --git a/src/main/java/org/ldk/structs/KeysManager.java b/src/main/java/org/ldk/structs/KeysManager.java index 04563c42..25107f06 100644 --- a/src/main/java/org/ldk/structs/KeysManager.java +++ b/src/main/java/org/ldk/structs/KeysManager.java @@ -47,7 +47,7 @@ public class KeysManager extends CommonBase { * detailed description of the guarantee. */ public static KeysManager of(byte[] seed, long starting_time_secs, int starting_time_nanos) { - long ret = bindings.KeysManager_new(seed, starting_time_secs, starting_time_nanos); + long ret = bindings.KeysManager_new(InternalUtils.check_arr_len(seed, 32), starting_time_secs, starting_time_nanos); if (ret >= 0 && ret <= 4096) { return null; } KeysManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new KeysManager(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -62,7 +62,7 @@ public class KeysManager extends CommonBase { * onchain output detection for which a corresponding delayed_payment_key must be derived. */ public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] params) { - long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params); + long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(params, 32)); if (ret >= 0 && ret <= 4096) { return null; } InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); } ret_hu_conv.ptrs_to.add(this); diff --git a/src/main/java/org/ldk/structs/LightningError.java b/src/main/java/org/ldk/structs/LightningError.java index 93785a26..74702588 100644 --- a/src/main/java/org/ldk/structs/LightningError.java +++ b/src/main/java/org/ldk/structs/LightningError.java @@ -63,6 +63,11 @@ public class LightningError extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.LightningError_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the LightningError */ diff --git a/src/main/java/org/ldk/structs/Listen.java b/src/main/java/org/ldk/structs/Listen.java index 2e6b835d..8c57278a 100644 --- a/src/main/java/org/ldk/structs/Listen.java +++ b/src/main/java/org/ldk/structs/Listen.java @@ -63,7 +63,7 @@ public class Listen extends CommonBase { * Notifies the listener that a block was removed at the given height. */ public void block_disconnected(byte[] header, int height) { - bindings.Listen_block_disconnected(this.ptr, header, height); + bindings.Listen_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height); } } diff --git a/src/main/java/org/ldk/structs/Logger.java b/src/main/java/org/ldk/structs/Logger.java index 3535744d..8c5660d9 100644 --- a/src/main/java/org/ldk/structs/Logger.java +++ b/src/main/java/org/ldk/structs/Logger.java @@ -27,14 +27,15 @@ public class Logger extends CommonBase { /** * Logs the `Record` */ - void log(String record); + void log(Record record); } private static class LDKLoggerHolder { Logger held; } public static Logger new_impl(LoggerInterface arg) { final LDKLoggerHolder impl_holder = new LDKLoggerHolder(); impl_holder.held = new Logger(new bindings.LDKLogger() { - @Override public void log(String record) { - arg.log(record); + @Override public void log(long record) { + Record record_hu_conv = null; if (record < 0 || record > 4096) { record_hu_conv = new Record(null, record); } + arg.log(record_hu_conv); } }); return impl_holder.held; diff --git a/src/main/java/org/ldk/structs/MessageSendEvent.java b/src/main/java/org/ldk/structs/MessageSendEvent.java index 2f8e79d3..83e29cf7 100644 --- a/src/main/java/org/ldk/structs/MessageSendEvent.java +++ b/src/main/java/org/ldk/structs/MessageSendEvent.java @@ -82,6 +82,10 @@ public class MessageSendEvent extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * Used to indicate that we've accepted a channel open and should send the accept_channel + * message provided to the given peer. + */ public final static class SendAcceptChannel extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -100,6 +104,10 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that we've initiated a channel open and should send the open_channel + * message provided to the given peer. + */ public final static class SendOpenChannel extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -118,6 +126,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a funding_created message should be sent to the peer with the given node_id. + */ public final static class SendFundingCreated extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -136,6 +147,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a funding_signed message should be sent to the peer with the given node_id. + */ public final static class SendFundingSigned extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -154,6 +168,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a funding_locked message should be sent to the peer with the given node_id. + */ public final static class SendFundingLocked extends MessageSendEvent { /** * The node_id of the node which should receive these message(s) @@ -172,6 +189,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id. + */ public final static class SendAnnouncementSignatures extends MessageSendEvent { /** * The node_id of the node which should receive these message(s) @@ -190,6 +210,10 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a series of HTLC update messages, as well as a commitment_signed + * message should be sent to the peer with the given node_id. + */ public final static class UpdateHTLCs extends MessageSendEvent { /** * The node_id of the node which should receive these message(s) @@ -208,6 +232,9 @@ public class MessageSendEvent extends CommonBase { this.updates = updates_hu_conv; } } + /** + * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id. + */ public final static class SendRevokeAndACK extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -226,6 +253,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a closing_signed message should be sent to the peer with the given node_id. + */ public final static class SendClosingSigned extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -244,6 +274,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a shutdown message should be sent to the peer with the given node_id. + */ public final static class SendShutdown extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -262,6 +295,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id. + */ public final static class SendChannelReestablish extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -280,6 +316,16 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a channel_announcement and channel_update should be broadcast to all + * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2). + * + * Note that after doing so, you very likely (unless you did so very recently) want to call + * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event. + * This ensures that any nodes which see our channel_announcement also have a relevant + * node_announcement, including relevant feature flags which may be important for routing + * through or to us. + */ public final static class BroadcastChannelAnnouncement extends MessageSendEvent { /** * The channel_announcement which should be sent. @@ -301,6 +347,9 @@ public class MessageSendEvent extends CommonBase { this.update_msg = update_msg_hu_conv; } } + /** + * Used to indicate that a node_announcement should be broadcast to all peers. + */ public final static class BroadcastNodeAnnouncement extends MessageSendEvent { /** * The node_announcement which should be sent. @@ -314,6 +363,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a channel_update should be broadcast to all peers. + */ public final static class BroadcastChannelUpdate extends MessageSendEvent { /** * The channel_update which should be sent. @@ -327,6 +379,11 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Used to indicate that a channel_update should be sent to a single peer. + * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a + * private channel and we shouldn't be informing all of our peers of channel parameters. + */ public final static class SendChannelUpdate extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -345,6 +402,9 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Broadcast an error downstream to be handled + */ public final static class HandleError extends MessageSendEvent { /** * The node_id of the node which should receive this message @@ -363,6 +423,9 @@ public class MessageSendEvent extends CommonBase { this.action = action_hu_conv; } } + /** + * Query a peer for channels with funding transaction UTXOs in a block range. + */ public final static class SendChannelRangeQuery extends MessageSendEvent { /** * The node_id of this message recipient @@ -381,6 +444,10 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Request routing gossip messages from a peer for a list of channels identified by + * their short_channel_ids. + */ public final static class SendShortIdsQuery extends MessageSendEvent { /** * The node_id of this message recipient @@ -399,6 +466,10 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + /** + * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events + * emitted during processing of the query. + */ public final static class SendReplyChannelRange extends MessageSendEvent { /** * The node_id of this message recipient @@ -417,6 +488,11 @@ public class MessageSendEvent extends CommonBase { this.msg = msg_hu_conv; } } + long clone_ptr() { + long ret = bindings.MessageSendEvent_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the MessageSendEvent */ @@ -432,7 +508,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent */ public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) { - long ret = bindings.MessageSendEvent_send_accept_channel(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -443,7 +519,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent */ public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) { - long ret = bindings.MessageSendEvent_send_open_channel(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -454,7 +530,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent */ public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) { - long ret = bindings.MessageSendEvent_send_funding_created(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -465,7 +541,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent */ public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) { - long ret = bindings.MessageSendEvent_send_funding_signed(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -476,7 +552,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent */ public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) { - long ret = bindings.MessageSendEvent_send_funding_locked(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_funding_locked(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -487,7 +563,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent */ public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) { - long ret = bindings.MessageSendEvent_send_announcement_signatures(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -498,7 +574,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent */ public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) { - long ret = bindings.MessageSendEvent_update_htlcs(node_id, updates == null ? 0 : updates.ptr & ~1); + long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -509,7 +585,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent */ public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) { - long ret = bindings.MessageSendEvent_send_revoke_and_ack(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -520,7 +596,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent */ public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) { - long ret = bindings.MessageSendEvent_send_closing_signed(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -531,7 +607,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendShutdown-variant MessageSendEvent */ public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) { - long ret = bindings.MessageSendEvent_send_shutdown(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -542,7 +618,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent */ public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) { - long ret = bindings.MessageSendEvent_send_channel_reestablish(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -586,7 +662,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent */ public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) { - long ret = bindings.MessageSendEvent_send_channel_update(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -597,7 +673,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new HandleError-variant MessageSendEvent */ public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) { - long ret = bindings.MessageSendEvent_handle_error(node_id, action.ptr); + long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -608,7 +684,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent */ public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) { - long ret = bindings.MessageSendEvent_send_channel_range_query(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -619,7 +695,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent */ public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) { - long ret = bindings.MessageSendEvent_send_short_ids_query(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -630,7 +706,7 @@ public class MessageSendEvent extends CommonBase { * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent */ public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) { - long ret = bindings.MessageSendEvent_send_reply_channel_range(node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/MessageSendEventsProvider.java b/src/main/java/org/ldk/structs/MessageSendEventsProvider.java index b4c54c2e..85117b98 100644 --- a/src/main/java/org/ldk/structs/MessageSendEventsProvider.java +++ b/src/main/java/org/ldk/structs/MessageSendEventsProvider.java @@ -36,7 +36,7 @@ public class MessageSendEventsProvider extends CommonBase { impl_holder.held = new MessageSendEventsProvider(new bindings.LDKMessageSendEventsProvider() { @Override public long[] get_and_clear_pending_msg_events() { MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events(); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18.ptr).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.clone_ptr()).toArray() : null; return result; } }); diff --git a/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java b/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java index 5eab27cd..56f6937b 100644 --- a/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java +++ b/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java @@ -39,6 +39,11 @@ public class MinFinalCltvExpiry extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.MinFinalCltvExpiry_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the MinFinalCltvExpiry */ diff --git a/src/main/java/org/ldk/structs/MonitorEvent.java b/src/main/java/org/ldk/structs/MonitorEvent.java index da40b184..38a63b38 100644 --- a/src/main/java/org/ldk/structs/MonitorEvent.java +++ b/src/main/java/org/ldk/structs/MonitorEvent.java @@ -35,6 +35,9 @@ public class MonitorEvent extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * A monitor event containing an HTLCUpdate. + */ public final static class HTLCEvent extends MonitorEvent { public final HTLCUpdate htlc_event; private HTLCEvent(long ptr, bindings.LDKMonitorEvent.HTLCEvent obj) { @@ -45,6 +48,9 @@ public class MonitorEvent extends CommonBase { this.htlc_event = htlc_event_hu_conv; } } + /** + * A monitor event that the Channel's commitment transaction was confirmed. + */ public final static class CommitmentTxConfirmed extends MonitorEvent { public final OutPoint commitment_tx_confirmed; private CommitmentTxConfirmed(long ptr, bindings.LDKMonitorEvent.CommitmentTxConfirmed obj) { @@ -55,6 +61,12 @@ public class MonitorEvent extends CommonBase { this.commitment_tx_confirmed = commitment_tx_confirmed_hu_conv; } } + /** + * Indicates a [`ChannelMonitor`] update has completed. See + * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used. + * + * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure + */ public final static class UpdateCompleted extends MonitorEvent { /** * The funding outpoint of the [`ChannelMonitor`] that was updated @@ -77,6 +89,12 @@ public class MonitorEvent extends CommonBase { this.monitor_update_id = obj.monitor_update_id; } } + /** + * Indicates a [`ChannelMonitor`] update has failed. See + * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used. + * + * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure + */ public final static class UpdateFailed extends MonitorEvent { public final OutPoint update_failed; private UpdateFailed(long ptr, bindings.LDKMonitorEvent.UpdateFailed obj) { @@ -87,6 +105,11 @@ public class MonitorEvent extends CommonBase { this.update_failed = update_failed_hu_conv; } } + long clone_ptr() { + long ret = bindings.MonitorEvent_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the MonitorEvent */ diff --git a/src/main/java/org/ldk/structs/MonitorUpdateError.java b/src/main/java/org/ldk/structs/MonitorUpdateError.java index cac258b2..aa425da9 100644 --- a/src/main/java/org/ldk/structs/MonitorUpdateError.java +++ b/src/main/java/org/ldk/structs/MonitorUpdateError.java @@ -43,6 +43,11 @@ public class MonitorUpdateError extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.MonitorUpdateError_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the MonitorUpdateError */ diff --git a/src/main/java/org/ldk/structs/MonitorUpdateId.java b/src/main/java/org/ldk/structs/MonitorUpdateId.java index 8da5bb67..bdc9e7f1 100644 --- a/src/main/java/org/ldk/structs/MonitorUpdateId.java +++ b/src/main/java/org/ldk/structs/MonitorUpdateId.java @@ -19,6 +19,11 @@ public class MonitorUpdateId extends CommonBase { if (ptr != 0) { bindings.MonitorUpdateId_free(ptr); } } + long clone_ptr() { + long ret = bindings.MonitorUpdateId_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the MonitorUpdateId */ diff --git a/src/main/java/org/ldk/structs/NetAddress.java b/src/main/java/org/ldk/structs/NetAddress.java index 5a26a2a0..242e169a 100644 --- a/src/main/java/org/ldk/structs/NetAddress.java +++ b/src/main/java/org/ldk/structs/NetAddress.java @@ -35,6 +35,9 @@ public class NetAddress extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * An IPv4 address/port on which the peer is listening. + */ public final static class IPv4 extends NetAddress { /** * The 4-byte IPv4 address @@ -50,6 +53,9 @@ public class NetAddress extends CommonBase { this.port = obj.port; } } + /** + * An IPv6 address/port on which the peer is listening. + */ public final static class IPv6 extends NetAddress { /** * The 16-byte IPv6 address @@ -65,6 +71,9 @@ public class NetAddress extends CommonBase { this.port = obj.port; } } + /** + * An old-style Tor onion address/port on which the peer is listening. + */ public final static class OnionV2 extends NetAddress { /** * The bytes (usually encoded in base32 with \".onion\" appended) @@ -80,6 +89,11 @@ public class NetAddress extends CommonBase { this.port = obj.port; } } + /** + * A new-style Tor onion address/port on which the peer is listening. + * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version, + * wrap as base32 and append \".onion\". + */ public final static class OnionV3 extends NetAddress { /** * The ed25519 long-term public key of the peer @@ -105,6 +119,11 @@ public class NetAddress extends CommonBase { this.port = obj.port; } } + long clone_ptr() { + long ret = bindings.NetAddress_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the NetAddress */ @@ -120,7 +139,7 @@ public class NetAddress extends CommonBase { * Utility method to constructs a new IPv4-variant NetAddress */ public static NetAddress ipv4(byte[] addr, short port) { - long ret = bindings.NetAddress_ipv4(addr, port); + long ret = bindings.NetAddress_ipv4(InternalUtils.check_arr_len(addr, 4), port); if (ret >= 0 && ret <= 4096) { return null; } NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -131,7 +150,7 @@ public class NetAddress extends CommonBase { * Utility method to constructs a new IPv6-variant NetAddress */ public static NetAddress ipv6(byte[] addr, short port) { - long ret = bindings.NetAddress_ipv6(addr, port); + long ret = bindings.NetAddress_ipv6(InternalUtils.check_arr_len(addr, 16), port); if (ret >= 0 && ret <= 4096) { return null; } NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -142,7 +161,7 @@ public class NetAddress extends CommonBase { * Utility method to constructs a new OnionV2-variant NetAddress */ public static NetAddress onion_v2(byte[] addr, short port) { - long ret = bindings.NetAddress_onion_v2(addr, port); + long ret = bindings.NetAddress_onion_v2(InternalUtils.check_arr_len(addr, 10), port); if (ret >= 0 && ret <= 4096) { return null; } NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -153,7 +172,7 @@ public class NetAddress extends CommonBase { * Utility method to constructs a new OnionV3-variant NetAddress */ public static NetAddress onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port) { - long ret = bindings.NetAddress_onion_v3(ed25519_pubkey, checksum, version, port); + long ret = bindings.NetAddress_onion_v3(InternalUtils.check_arr_len(ed25519_pubkey, 32), checksum, version, port); if (ret >= 0 && ret <= 4096) { return null; } NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java index debc8fe4..4331c73f 100644 --- a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java +++ b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java @@ -51,6 +51,7 @@ public class NetGraphMsgHandler extends CommonBase { NetGraphMsgHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NetGraphMsgHandler(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(network_graph); + ret_hu_conv.ptrs_to.add(chain_access); ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } @@ -62,6 +63,7 @@ public class NetGraphMsgHandler extends CommonBase { */ public void add_chain_access(Option_AccessZ chain_access) { bindings.NetGraphMsgHandler_add_chain_access(this.ptr, chain_access.ptr); + this.ptrs_to.add(chain_access); } /** diff --git a/src/main/java/org/ldk/structs/NetworkGraph.java b/src/main/java/org/ldk/structs/NetworkGraph.java index 299f4547..1c2469d4 100644 --- a/src/main/java/org/ldk/structs/NetworkGraph.java +++ b/src/main/java/org/ldk/structs/NetworkGraph.java @@ -19,6 +19,11 @@ public class NetworkGraph extends CommonBase { if (ptr != 0) { bindings.NetworkGraph_free(ptr); } } + long clone_ptr() { + long ret = bindings.NetworkGraph_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the NetworkGraph */ @@ -52,7 +57,7 @@ public class NetworkGraph extends CommonBase { * Creates a new, empty, network graph. */ public static NetworkGraph of(byte[] genesis_hash) { - long ret = bindings.NetworkGraph_new(genesis_hash); + long ret = bindings.NetworkGraph_new(InternalUtils.check_arr_len(genesis_hash, 32)); if (ret >= 0 && ret <= 4096) { return null; } NetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NetworkGraph(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -115,6 +120,7 @@ public class NetworkGraph extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); + this.ptrs_to.add(chain_access); return ret_hu_conv; } @@ -131,6 +137,7 @@ public class NetworkGraph extends CommonBase { if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); + this.ptrs_to.add(chain_access); return ret_hu_conv; } @@ -148,7 +155,7 @@ public class NetworkGraph extends CommonBase { * Marks a node in the graph as failed. */ public void fail_node(byte[] _node_id, boolean is_permanent) { - bindings.NetworkGraph_fail_node(this.ptr, _node_id, is_permanent); + bindings.NetworkGraph_fail_node(this.ptr, InternalUtils.check_arr_len(_node_id, 33), is_permanent); } /** diff --git a/src/main/java/org/ldk/structs/NetworkUpdate.java b/src/main/java/org/ldk/structs/NetworkUpdate.java index 01e36141..8abc8b58 100644 --- a/src/main/java/org/ldk/structs/NetworkUpdate.java +++ b/src/main/java/org/ldk/structs/NetworkUpdate.java @@ -35,6 +35,10 @@ public class NetworkUpdate extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * An error indicating a `channel_update` messages should be applied via + * [`NetworkGraph::update_channel`]. + */ public final static class ChannelUpdateMessage extends NetworkUpdate { /** * The update to apply via [`NetworkGraph::update_channel`]. @@ -48,6 +52,10 @@ public class NetworkUpdate extends CommonBase { this.msg = msg_hu_conv; } } + /** + * An error indicating only that a channel has been closed, which should be applied via + * [`NetworkGraph::close_channel_from_update`]. + */ public final static class ChannelClosed extends NetworkUpdate { /** * The short channel id of the closed channel. @@ -64,6 +72,10 @@ public class NetworkUpdate extends CommonBase { this.is_permanent = obj.is_permanent; } } + /** + * An error indicating only that a node has failed, which should be applied via + * [`NetworkGraph::fail_node`]. + */ public final static class NodeFailure extends NetworkUpdate { /** * The node id of the failed node. @@ -80,6 +92,11 @@ public class NetworkUpdate extends CommonBase { this.is_permanent = obj.is_permanent; } } + long clone_ptr() { + long ret = bindings.NetworkUpdate_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the NetworkUpdate */ @@ -117,7 +134,7 @@ public class NetworkUpdate extends CommonBase { * Utility method to constructs a new NodeFailure-variant NetworkUpdate */ public static NetworkUpdate node_failure(byte[] node_id, boolean is_permanent) { - long ret = bindings.NetworkUpdate_node_failure(node_id, is_permanent); + long ret = bindings.NetworkUpdate_node_failure(InternalUtils.check_arr_len(node_id, 33), is_permanent); if (ret >= 0 && ret <= 4096) { return null; } NetworkUpdate ret_hu_conv = NetworkUpdate.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index 40c01d80..da8ce46b 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -31,7 +31,7 @@ public class NodeAnnouncement extends CommonBase { * The signature by the node key */ public void set_signature(byte[] val) { - bindings.NodeAnnouncement_set_signature(this.ptr, val); + bindings.NodeAnnouncement_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } /** @@ -56,13 +56,18 @@ public class NodeAnnouncement extends CommonBase { * Constructs a new NodeAnnouncement given each field */ public static NodeAnnouncement of(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) { - long ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + long ret = bindings.NodeAnnouncement_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.NodeAnnouncement_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the NodeAnnouncement */ diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java index f0a745f9..7b029328 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java @@ -66,7 +66,7 @@ public class NodeAnnouncementInfo extends CommonBase { * Color assigned to the node */ public void set_rgb(byte[] val) { - bindings.NodeAnnouncementInfo_set_rgb(this.ptr, val); + bindings.NodeAnnouncementInfo_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3)); } /** @@ -85,7 +85,7 @@ public class NodeAnnouncementInfo extends CommonBase { * should not be exposed to the user. */ public void set_alias(byte[] val) { - bindings.NodeAnnouncementInfo_set_alias(this.ptr, val); + bindings.NodeAnnouncementInfo_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -128,13 +128,18 @@ public class NodeAnnouncementInfo extends CommonBase { * Constructs a new NodeAnnouncementInfo given each field */ public static NodeAnnouncementInfo of(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) { - long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, addresses_arg != null ? Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray() : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); + long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), InternalUtils.check_arr_len(alias_arg, 32), addresses_arg != null ? Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray() : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncementInfo(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.NodeAnnouncementInfo_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the NodeAnnouncementInfo */ diff --git a/src/main/java/org/ldk/structs/NodeFeatures.java b/src/main/java/org/ldk/structs/NodeFeatures.java index ebd78144..1a05b6d5 100644 --- a/src/main/java/org/ldk/structs/NodeFeatures.java +++ b/src/main/java/org/ldk/structs/NodeFeatures.java @@ -30,6 +30,11 @@ public class NodeFeatures extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.NodeFeatures_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the NodeFeatures */ diff --git a/src/main/java/org/ldk/structs/NodeId.java b/src/main/java/org/ldk/structs/NodeId.java index e74d649a..a0074a65 100644 --- a/src/main/java/org/ldk/structs/NodeId.java +++ b/src/main/java/org/ldk/structs/NodeId.java @@ -19,6 +19,11 @@ public class NodeId extends CommonBase { if (ptr != 0) { bindings.NodeId_free(ptr); } } + long clone_ptr() { + long ret = bindings.NodeId_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the NodeId */ @@ -34,7 +39,7 @@ public class NodeId extends CommonBase { * Create a new NodeId from a public key */ public static NodeId from_pubkey(byte[] pubkey) { - long ret = bindings.NodeId_from_pubkey(pubkey); + long ret = bindings.NodeId_from_pubkey(InternalUtils.check_arr_len(pubkey, 33)); if (ret >= 0 && ret <= 4096) { return null; } NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/NodeInfo.java b/src/main/java/org/ldk/structs/NodeInfo.java index f599db75..e091c6c6 100644 --- a/src/main/java/org/ldk/structs/NodeInfo.java +++ b/src/main/java/org/ldk/structs/NodeInfo.java @@ -91,6 +91,11 @@ public class NodeInfo extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.NodeInfo_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the NodeInfo */ diff --git a/src/main/java/org/ldk/structs/OpenChannel.java b/src/main/java/org/ldk/structs/OpenChannel.java index ff78eea1..46dee55c 100644 --- a/src/main/java/org/ldk/structs/OpenChannel.java +++ b/src/main/java/org/ldk/structs/OpenChannel.java @@ -31,7 +31,7 @@ public class OpenChannel extends CommonBase { * The genesis hash of the blockchain where the channel is to be opened */ public void set_chain_hash(byte[] val) { - bindings.OpenChannel_set_chain_hash(this.ptr, val); + bindings.OpenChannel_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -46,7 +46,7 @@ public class OpenChannel extends CommonBase { * A temporary channel ID, until the funding outpoint is announced */ public void set_temporary_channel_id(byte[] val) { - bindings.OpenChannel_set_temporary_channel_id(this.ptr, val); + bindings.OpenChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -196,7 +196,7 @@ public class OpenChannel extends CommonBase { * The sender's key controlling the funding transaction */ public void set_funding_pubkey(byte[] val) { - bindings.OpenChannel_set_funding_pubkey(this.ptr, val); + bindings.OpenChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -211,7 +211,7 @@ public class OpenChannel extends CommonBase { * Used to derive a revocation key for transactions broadcast by counterparty */ public void set_revocation_basepoint(byte[] val) { - bindings.OpenChannel_set_revocation_basepoint(this.ptr, val); + bindings.OpenChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -226,7 +226,7 @@ public class OpenChannel extends CommonBase { * A payment key to sender for transactions broadcast by counterparty */ public void set_payment_point(byte[] val) { - bindings.OpenChannel_set_payment_point(this.ptr, val); + bindings.OpenChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -241,7 +241,7 @@ public class OpenChannel extends CommonBase { * Used to derive a payment key to sender for transactions broadcast by sender */ public void set_delayed_payment_basepoint(byte[] val) { - bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, val); + bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -256,7 +256,7 @@ public class OpenChannel extends CommonBase { * Used to derive an HTLC payment key to sender */ public void set_htlc_basepoint(byte[] val) { - bindings.OpenChannel_set_htlc_basepoint(this.ptr, val); + bindings.OpenChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -271,7 +271,7 @@ public class OpenChannel extends CommonBase { * The first to-be-broadcast-by-sender transaction's per commitment point */ public void set_first_per_commitment_point(byte[] val) { - bindings.OpenChannel_set_first_per_commitment_point(this.ptr, val); + bindings.OpenChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -289,6 +289,11 @@ public class OpenChannel extends CommonBase { bindings.OpenChannel_set_channel_flags(this.ptr, val); } + long clone_ptr() { + long ret = bindings.OpenChannel_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the OpenChannel */ diff --git a/src/main/java/org/ldk/structs/Option_AccessZ.java b/src/main/java/org/ldk/structs/Option_AccessZ.java index 30119e33..cb7b1325 100644 --- a/src/main/java/org/ldk/structs/Option_AccessZ.java +++ b/src/main/java/org/ldk/structs/Option_AccessZ.java @@ -29,6 +29,9 @@ public class Option_AccessZ extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access + */ public final static class Some extends Option_AccessZ { public final Access some; private Some(long ptr, bindings.LDKCOption_AccessZ.Some obj) { @@ -39,6 +42,9 @@ public class Option_AccessZ extends CommonBase { this.some = ret_hu_conv; } } + /** + * When we're in this state, this COption_AccessZ contains nothing + */ public final static class None extends Option_AccessZ { private None(long ptr, bindings.LDKCOption_AccessZ.None obj) { super(null, ptr); diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java index 4c07583c..429e51c2 100644 --- a/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java @@ -29,6 +29,9 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ + */ public final static class Some extends Option_C2Tuple_usizeTransactionZZ { public final TwoTuple_usizeTransactionZ some; private Some(long ptr, bindings.LDKCOption_C2Tuple_usizeTransactionZZ.Some obj) { @@ -39,6 +42,9 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase { this.some = some_hu_conv; } } + /** + * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing + */ public final static class None extends Option_C2Tuple_usizeTransactionZZ { private None(long ptr, bindings.LDKCOption_C2Tuple_usizeTransactionZZ.None obj) { super(null, ptr); @@ -66,6 +72,11 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Option_CVec_NetAddressZZ.java b/src/main/java/org/ldk/structs/Option_CVec_NetAddressZZ.java index 9ae23246..a3e77a30 100644 --- a/src/main/java/org/ldk/structs/Option_CVec_NetAddressZZ.java +++ b/src/main/java/org/ldk/structs/Option_CVec_NetAddressZZ.java @@ -29,6 +29,9 @@ public class Option_CVec_NetAddressZZ extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ + */ public final static class Some extends Option_CVec_NetAddressZZ { public final NetAddress[] some; private Some(long ptr, bindings.LDKCOption_CVec_NetAddressZZ.Some obj) { @@ -44,6 +47,9 @@ public class Option_CVec_NetAddressZZ extends CommonBase { this.some = some_conv_12_arr; } } + /** + * When we're in this state, this COption_CVec_NetAddressZZ contains nothing + */ public final static class None extends Option_CVec_NetAddressZZ { private None(long ptr, bindings.LDKCOption_CVec_NetAddressZZ.None obj) { super(null, ptr); @@ -71,6 +77,11 @@ public class Option_CVec_NetAddressZZ extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_CVec_NetAddressZZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java b/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java new file mode 100644 index 00000000..6db3b380 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java @@ -0,0 +1,92 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::lightning::util::events::ClosureReason or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_ClosureReasonZ extends CommonBase { + private Option_ClosureReasonZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_ClosureReasonZ_free(ptr); } + } + static Option_ClosureReasonZ constr_from_ptr(long ptr) { + bindings.LDKCOption_ClosureReasonZ raw_val = bindings.LDKCOption_ClosureReasonZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_ClosureReasonZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_ClosureReasonZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_ClosureReasonZ.None.class) { + return new None(ptr, (bindings.LDKCOption_ClosureReasonZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason + */ + public final static class Some extends Option_ClosureReasonZ { + public final ClosureReason some; + private Some(long ptr, bindings.LDKCOption_ClosureReasonZ.Some obj) { + super(null, ptr); + long some = obj.some; + ClosureReason some_hu_conv = ClosureReason.constr_from_ptr(some); + some_hu_conv.ptrs_to.add(this); + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_ClosureReasonZ contains nothing + */ + public final static class None extends Option_ClosureReasonZ { + private None(long ptr, bindings.LDKCOption_ClosureReasonZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason + */ + public static Option_ClosureReasonZ some(ClosureReason o) { + long ret = bindings.COption_ClosureReasonZ_some(o.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Option_ClosureReasonZ ret_hu_conv = Option_ClosureReasonZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Constructs a new COption_ClosureReasonZ containing nothing + */ + public static Option_ClosureReasonZ none() { + long ret = bindings.COption_ClosureReasonZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + Option_ClosureReasonZ ret_hu_conv = Option_ClosureReasonZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_ClosureReasonZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new COption_ClosureReasonZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_ClosureReasonZ clone() { + long ret = bindings.COption_ClosureReasonZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Option_ClosureReasonZ ret_hu_conv = Option_ClosureReasonZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_EventZ.java b/src/main/java/org/ldk/structs/Option_EventZ.java new file mode 100644 index 00000000..aa22da99 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_EventZ.java @@ -0,0 +1,92 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::lightning::util::events::Event or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_EventZ extends CommonBase { + private Option_EventZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_EventZ_free(ptr); } + } + static Option_EventZ constr_from_ptr(long ptr) { + bindings.LDKCOption_EventZ raw_val = bindings.LDKCOption_EventZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_EventZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_EventZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_EventZ.None.class) { + return new None(ptr, (bindings.LDKCOption_EventZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event + */ + public final static class Some extends Option_EventZ { + public final Event some; + private Some(long ptr, bindings.LDKCOption_EventZ.Some obj) { + super(null, ptr); + long some = obj.some; + Event some_hu_conv = Event.constr_from_ptr(some); + some_hu_conv.ptrs_to.add(this); + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_EventZ contains nothing + */ + public final static class None extends Option_EventZ { + private None(long ptr, bindings.LDKCOption_EventZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event + */ + public static Option_EventZ some(Event o) { + long ret = bindings.COption_EventZ_some(o.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Constructs a new COption_EventZ containing nothing + */ + public static Option_EventZ none() { + long ret = bindings.COption_EventZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_EventZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new COption_EventZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_EventZ clone() { + long ret = bindings.COption_EventZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_FilterZ.java b/src/main/java/org/ldk/structs/Option_FilterZ.java index ac669f02..0561ae71 100644 --- a/src/main/java/org/ldk/structs/Option_FilterZ.java +++ b/src/main/java/org/ldk/structs/Option_FilterZ.java @@ -29,6 +29,9 @@ public class Option_FilterZ extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter + */ public final static class Some extends Option_FilterZ { public final Filter some; private Some(long ptr, bindings.LDKCOption_FilterZ.Some obj) { @@ -39,6 +42,9 @@ public class Option_FilterZ extends CommonBase { this.some = ret_hu_conv; } } + /** + * When we're in this state, this COption_FilterZ contains nothing + */ public final static class None extends Option_FilterZ { private None(long ptr, bindings.LDKCOption_FilterZ.None obj) { super(null, ptr); diff --git a/src/main/java/org/ldk/structs/Option_MonitorEventZ.java b/src/main/java/org/ldk/structs/Option_MonitorEventZ.java new file mode 100644 index 00000000..032e1f39 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_MonitorEventZ.java @@ -0,0 +1,92 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_MonitorEventZ extends CommonBase { + private Option_MonitorEventZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_MonitorEventZ_free(ptr); } + } + static Option_MonitorEventZ constr_from_ptr(long ptr) { + bindings.LDKCOption_MonitorEventZ raw_val = bindings.LDKCOption_MonitorEventZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_MonitorEventZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_MonitorEventZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_MonitorEventZ.None.class) { + return new None(ptr, (bindings.LDKCOption_MonitorEventZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent + */ + public final static class Some extends Option_MonitorEventZ { + public final MonitorEvent some; + private Some(long ptr, bindings.LDKCOption_MonitorEventZ.Some obj) { + super(null, ptr); + long some = obj.some; + MonitorEvent some_hu_conv = MonitorEvent.constr_from_ptr(some); + some_hu_conv.ptrs_to.add(this); + this.some = some_hu_conv; + } + } + /** + * When we're in this state, this COption_MonitorEventZ contains nothing + */ + public final static class None extends Option_MonitorEventZ { + private None(long ptr, bindings.LDKCOption_MonitorEventZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent + */ + public static Option_MonitorEventZ some(MonitorEvent o) { + long ret = bindings.COption_MonitorEventZ_some(o.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Option_MonitorEventZ ret_hu_conv = Option_MonitorEventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Constructs a new COption_MonitorEventZ containing nothing + */ + public static Option_MonitorEventZ none() { + long ret = bindings.COption_MonitorEventZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + Option_MonitorEventZ ret_hu_conv = Option_MonitorEventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_MonitorEventZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new COption_MonitorEventZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_MonitorEventZ clone() { + long ret = bindings.COption_MonitorEventZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Option_MonitorEventZ ret_hu_conv = Option_MonitorEventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java b/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java index 6657b05e..dbd7fcbf 100644 --- a/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java +++ b/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java @@ -29,6 +29,9 @@ public class Option_NetworkUpdateZ extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::network_graph::NetworkUpdate + */ public final static class Some extends Option_NetworkUpdateZ { public final NetworkUpdate some; private Some(long ptr, bindings.LDKCOption_NetworkUpdateZ.Some obj) { @@ -39,6 +42,9 @@ public class Option_NetworkUpdateZ extends CommonBase { this.some = some_hu_conv; } } + /** + * When we're in this state, this COption_NetworkUpdateZ contains nothing + */ public final static class None extends Option_NetworkUpdateZ { private None(long ptr, bindings.LDKCOption_NetworkUpdateZ.None obj) { super(null, ptr); @@ -66,6 +72,11 @@ public class Option_NetworkUpdateZ extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_NetworkUpdateZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new COption_NetworkUpdateZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Option_TypeZ.java b/src/main/java/org/ldk/structs/Option_TypeZ.java index fffa4bb0..e528bdcb 100644 --- a/src/main/java/org/ldk/structs/Option_TypeZ.java +++ b/src/main/java/org/ldk/structs/Option_TypeZ.java @@ -29,6 +29,9 @@ public class Option_TypeZ extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type + */ public final static class Some extends Option_TypeZ { public final Type some; private Some(long ptr, bindings.LDKCOption_TypeZ.Some obj) { @@ -39,6 +42,9 @@ public class Option_TypeZ extends CommonBase { this.some = ret_hu_conv; } } + /** + * When we're in this state, this COption_TypeZ contains nothing + */ public final static class None extends Option_TypeZ { private None(long ptr, bindings.LDKCOption_TypeZ.None obj) { super(null, ptr); @@ -67,6 +73,11 @@ public class Option_TypeZ extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_TypeZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new COption_TypeZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Option_u16Z.java b/src/main/java/org/ldk/structs/Option_u16Z.java index 1ed16f3f..824247da 100644 --- a/src/main/java/org/ldk/structs/Option_u16Z.java +++ b/src/main/java/org/ldk/structs/Option_u16Z.java @@ -29,6 +29,9 @@ public class Option_u16Z extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_u16Z contains a u16 + */ public final static class Some extends Option_u16Z { public final short some; private Some(long ptr, bindings.LDKCOption_u16Z.Some obj) { @@ -36,6 +39,9 @@ public class Option_u16Z extends CommonBase { this.some = obj.some; } } + /** + * When we're in this state, this COption_u16Z contains nothing + */ public final static class None extends Option_u16Z { private None(long ptr, bindings.LDKCOption_u16Z.None obj) { super(null, ptr); @@ -63,6 +69,11 @@ public class Option_u16Z extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_u16Z_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new COption_u16Z which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Option_u32Z.java b/src/main/java/org/ldk/structs/Option_u32Z.java index 3c4fcd68..6a18abfb 100644 --- a/src/main/java/org/ldk/structs/Option_u32Z.java +++ b/src/main/java/org/ldk/structs/Option_u32Z.java @@ -29,6 +29,9 @@ public class Option_u32Z extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_u32Z contains a u32 + */ public final static class Some extends Option_u32Z { public final int some; private Some(long ptr, bindings.LDKCOption_u32Z.Some obj) { @@ -36,6 +39,9 @@ public class Option_u32Z extends CommonBase { this.some = obj.some; } } + /** + * When we're in this state, this COption_u32Z contains nothing + */ public final static class None extends Option_u32Z { private None(long ptr, bindings.LDKCOption_u32Z.None obj) { super(null, ptr); @@ -63,6 +69,11 @@ public class Option_u32Z extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_u32Z_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new COption_u32Z which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Option_u64Z.java b/src/main/java/org/ldk/structs/Option_u64Z.java index e4689c89..d4c900ba 100644 --- a/src/main/java/org/ldk/structs/Option_u64Z.java +++ b/src/main/java/org/ldk/structs/Option_u64Z.java @@ -29,6 +29,9 @@ public class Option_u64Z extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * When we're in this state, this COption_u64Z contains a u64 + */ public final static class Some extends Option_u64Z { public final long some; private Some(long ptr, bindings.LDKCOption_u64Z.Some obj) { @@ -36,6 +39,9 @@ public class Option_u64Z extends CommonBase { this.some = obj.some; } } + /** + * When we're in this state, this COption_u64Z contains nothing + */ public final static class None extends Option_u64Z { private None(long ptr, bindings.LDKCOption_u64Z.None obj) { super(null, ptr); @@ -63,6 +69,11 @@ public class Option_u64Z extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.COption_u64Z_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new COption_u64Z which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/OutPoint.java b/src/main/java/org/ldk/structs/OutPoint.java index edb13612..a181f35f 100644 --- a/src/main/java/org/ldk/structs/OutPoint.java +++ b/src/main/java/org/ldk/structs/OutPoint.java @@ -34,7 +34,7 @@ public class OutPoint extends CommonBase { * The referenced transaction's txid. */ public void set_txid(byte[] val) { - bindings.OutPoint_set_txid(this.ptr, val); + bindings.OutPoint_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -56,13 +56,18 @@ public class OutPoint extends CommonBase { * Constructs a new OutPoint given each field */ public static OutPoint of(byte[] txid_arg, short index_arg) { - long ret = bindings.OutPoint_new(txid_arg, index_arg); + long ret = bindings.OutPoint_new(InternalUtils.check_arr_len(txid_arg, 32), index_arg); if (ret >= 0 && ret <= 4096) { return null; } OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.OutPoint_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the OutPoint */ diff --git a/src/main/java/org/ldk/structs/Payee.java b/src/main/java/org/ldk/structs/Payee.java index 922f4883..317801b6 100644 --- a/src/main/java/org/ldk/structs/Payee.java +++ b/src/main/java/org/ldk/structs/Payee.java @@ -31,7 +31,7 @@ public class Payee extends CommonBase { * The node id of the payee. */ public void set_pubkey(byte[] val) { - bindings.Payee_set_pubkey(this.ptr, val); + bindings.Payee_set_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -111,13 +111,18 @@ public class Payee extends CommonBase { * Constructs a new Payee given each field */ public static Payee of(byte[] pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg) { - long ret = bindings.Payee_new(pubkey_arg, features_arg == null ? 0 : features_arg.ptr & ~1, route_hints_arg != null ? Arrays.stream(route_hints_arg).mapToLong(route_hints_arg_conv_11 -> route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr & ~1).toArray() : null, expiry_time_arg.ptr); + long ret = bindings.Payee_new(InternalUtils.check_arr_len(pubkey_arg, 33), features_arg == null ? 0 : features_arg.ptr & ~1, route_hints_arg != null ? Arrays.stream(route_hints_arg).mapToLong(route_hints_arg_conv_11 -> route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr & ~1).toArray() : null, expiry_time_arg.ptr); if (ret >= 0 && ret <= 4096) { return null; } Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.Payee_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Payee */ @@ -170,7 +175,7 @@ public class Payee extends CommonBase { * Creates a payee with the node id of the given `pubkey`. */ public static Payee from_node_id(byte[] pubkey) { - long ret = bindings.Payee_from_node_id(pubkey); + long ret = bindings.Payee_from_node_id(InternalUtils.check_arr_len(pubkey, 33)); if (ret >= 0 && ret <= 4096) { return null; } Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -181,7 +186,7 @@ public class Payee extends CommonBase { * Creates a payee with the node id of the given `pubkey` to use for keysend payments. */ public static Payee for_keysend(byte[] pubkey) { - long ret = bindings.Payee_for_keysend(pubkey); + long ret = bindings.Payee_for_keysend(InternalUtils.check_arr_len(pubkey, 33)); if (ret >= 0 && ret <= 4096) { return null; } Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/PayeePubKey.java b/src/main/java/org/ldk/structs/PayeePubKey.java index 5bf36b0a..3f1ef322 100644 --- a/src/main/java/org/ldk/structs/PayeePubKey.java +++ b/src/main/java/org/ldk/structs/PayeePubKey.java @@ -25,20 +25,25 @@ public class PayeePubKey extends CommonBase { } public void set_a(byte[] val) { - bindings.PayeePubKey_set_a(this.ptr, val); + bindings.PayeePubKey_set_a(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** * Constructs a new PayeePubKey given each field */ public static PayeePubKey of(byte[] a_arg) { - long ret = bindings.PayeePubKey_new(a_arg); + long ret = bindings.PayeePubKey_new(InternalUtils.check_arr_len(a_arg, 33)); if (ret >= 0 && ret <= 4096) { return null; } PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.PayeePubKey_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the PayeePubKey */ diff --git a/src/main/java/org/ldk/structs/Payer.java b/src/main/java/org/ldk/structs/Payer.java index bb7c58c0..4d488e92 100644 --- a/src/main/java/org/ldk/structs/Payer.java +++ b/src/main/java/org/ldk/structs/Payer.java @@ -49,23 +49,24 @@ public class Payer extends CommonBase { impl_holder.held = new Payer(new bindings.LDKPayer() { @Override public byte[] node_id() { byte[] ret = arg.node_id(); - return ret; + byte[] result = InternalUtils.check_arr_len(ret, 33); + return result; } @Override public long[] first_hops() { ChannelDetails[] ret = arg.first_hops(); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_16 -> ret_conv_16 == null ? 0 : ret_conv_16.ptr & ~1).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_16 -> ret_conv_16 == null ? 0 : ret_conv_16.clone_ptr()).toArray() : null; return result; } @Override public long send_payment(long route, byte[] payment_hash, byte[] payment_secret) { Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new Route(null, route); } Result_PaymentIdPaymentSendFailureZ ret = arg.send_payment(route_hu_conv, payment_hash, payment_secret); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long retry_payment(long route, byte[] payment_id) { Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new Route(null, route); } Result_NonePaymentSendFailureZ ret = arg.retry_payment(route_hu_conv, payment_id); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }); @@ -100,7 +101,7 @@ public class Payer extends CommonBase { * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None */ public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) { - long ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret); + long ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); @@ -111,7 +112,7 @@ public class Payer extends CommonBase { * Retries a failed payment path for the [`PaymentId`] using the given [`Route`]. */ public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) { - long ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_id); + long ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); diff --git a/src/main/java/org/ldk/structs/PaymentError.java b/src/main/java/org/ldk/structs/PaymentError.java index ca806da1..7f1d4935 100644 --- a/src/main/java/org/ldk/structs/PaymentError.java +++ b/src/main/java/org/ldk/structs/PaymentError.java @@ -32,6 +32,9 @@ public class PaymentError extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * An error resulting from the provided [`Invoice`] or payment hash. + */ public final static class Invoice extends PaymentError { public final String invoice; private Invoice(long ptr, bindings.LDKPaymentError.Invoice obj) { @@ -39,6 +42,9 @@ public class PaymentError extends CommonBase { this.invoice = obj.invoice; } } + /** + * An error occurring when finding a route. + */ public final static class Routing extends PaymentError { public final LightningError routing; private Routing(long ptr, bindings.LDKPaymentError.Routing obj) { @@ -49,6 +55,9 @@ public class PaymentError extends CommonBase { this.routing = routing_hu_conv; } } + /** + * An error occurring when sending a payment. + */ public final static class Sending extends PaymentError { public final PaymentSendFailure sending; private Sending(long ptr, bindings.LDKPaymentError.Sending obj) { @@ -59,6 +68,11 @@ public class PaymentError extends CommonBase { this.sending = sending_hu_conv; } } + long clone_ptr() { + long ret = bindings.PaymentError_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the PaymentError */ diff --git a/src/main/java/org/ldk/structs/PaymentPurpose.java b/src/main/java/org/ldk/structs/PaymentPurpose.java index 9290a3c5..3c404af4 100644 --- a/src/main/java/org/ldk/structs/PaymentPurpose.java +++ b/src/main/java/org/ldk/structs/PaymentPurpose.java @@ -30,6 +30,9 @@ public class PaymentPurpose extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * Information for receiving a payment that we generated an invoice for. + */ public final static class InvoicePayment extends PaymentPurpose { /** * The preimage to the payment_hash, if the payment hash (and secret) were fetched via @@ -73,6 +76,10 @@ public class PaymentPurpose extends CommonBase { this.user_payment_id = obj.user_payment_id; } } + /** + * Because this is a spontaneous payment, the payer generated their own preimage rather than us + * (the payee) providing a preimage. + */ public final static class SpontaneousPayment extends PaymentPurpose { public final byte[] spontaneous_payment; private SpontaneousPayment(long ptr, bindings.LDKPaymentPurpose.SpontaneousPayment obj) { @@ -80,6 +87,11 @@ public class PaymentPurpose extends CommonBase { this.spontaneous_payment = obj.spontaneous_payment; } } + long clone_ptr() { + long ret = bindings.PaymentPurpose_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the PaymentPurpose */ @@ -95,7 +107,7 @@ public class PaymentPurpose extends CommonBase { * Utility method to constructs a new InvoicePayment-variant PaymentPurpose */ public static PaymentPurpose invoice_payment(byte[] payment_preimage, byte[] payment_secret, long user_payment_id) { - long ret = bindings.PaymentPurpose_invoice_payment(payment_preimage, payment_secret, user_payment_id); + long ret = bindings.PaymentPurpose_invoice_payment(InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_secret, 32), user_payment_id); if (ret >= 0 && ret <= 4096) { return null; } PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -106,7 +118,7 @@ public class PaymentPurpose extends CommonBase { * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose */ public static PaymentPurpose spontaneous_payment(byte[] a) { - long ret = bindings.PaymentPurpose_spontaneous_payment(a); + long ret = bindings.PaymentPurpose_spontaneous_payment(InternalUtils.check_arr_len(a, 32)); if (ret >= 0 && ret <= 4096) { return null; } PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/PaymentSendFailure.java b/src/main/java/org/ldk/structs/PaymentSendFailure.java index 384d737a..1328b96e 100644 --- a/src/main/java/org/ldk/structs/PaymentSendFailure.java +++ b/src/main/java/org/ldk/structs/PaymentSendFailure.java @@ -37,6 +37,11 @@ public class PaymentSendFailure extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * A parameter which was passed to send_payment was invalid, preventing us from attempting to + * send the payment at all. No channel state has been changed or messages sent to peers, and + * once you've changed the parameter at error, you can freely retry the payment in full. + */ public final static class ParameterError extends PaymentSendFailure { public final APIError parameter_error; private ParameterError(long ptr, bindings.LDKPaymentSendFailure.ParameterError obj) { @@ -47,6 +52,15 @@ public class PaymentSendFailure extends CommonBase { this.parameter_error = parameter_error_hu_conv; } } + /** + * A parameter in a single path which was passed to send_payment was invalid, preventing us + * from attempting to send the payment at all. No channel state has been changed or messages + * sent to peers, and once you've changed the parameter at error, you can freely retry the + * payment in full. + * + * The results here are ordered the same as the paths in the route object which was passed to + * send_payment. + */ public final static class PathParameterError extends PaymentSendFailure { public final Result_NoneAPIErrorZ[] path_parameter_error; private PathParameterError(long ptr, bindings.LDKPaymentSendFailure.PathParameterError obj) { @@ -61,6 +75,11 @@ public class PaymentSendFailure extends CommonBase { this.path_parameter_error = path_parameter_error_conv_22_arr; } } + /** + * All paths which were attempted failed to send, with no channel state change taking place. + * You can freely retry the payment in full (though you probably want to do so over different + * paths than the ones selected). + */ public final static class AllFailedRetrySafe extends PaymentSendFailure { public final APIError[] all_failed_retry_safe; private AllFailedRetrySafe(long ptr, bindings.LDKPaymentSendFailure.AllFailedRetrySafe obj) { @@ -76,6 +95,20 @@ public class PaymentSendFailure extends CommonBase { this.all_failed_retry_safe = all_failed_retry_safe_conv_10_arr; } } + /** + * Some paths which were attempted failed to send, though possibly not all. At least some + * paths have irrevocably committed to the HTLC and retrying the payment in full would result + * in over-/re-payment. + * + * The results here are ordered the same as the paths in the route object which was passed to + * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely + * retried (though there is currently no API with which to do so). + * + * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried + * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the + * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel + * with the latest update_id. + */ public final static class PartialFailure extends PaymentSendFailure { /** * The errors themselves, in the same order as the route hops. @@ -110,6 +143,11 @@ public class PaymentSendFailure extends CommonBase { this.payment_id = obj.payment_id; } } + long clone_ptr() { + long ret = bindings.PaymentSendFailure_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the PaymentSendFailure */ @@ -158,7 +196,7 @@ public class PaymentSendFailure extends CommonBase { * Utility method to constructs a new PartialFailure-variant PaymentSendFailure */ public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] results, RouteParameters failed_paths_retry, byte[] payment_id) { - long ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).mapToLong(results_conv_22 -> results_conv_22 != null ? results_conv_22.ptr : 0).toArray() : null, failed_paths_retry == null ? 0 : failed_paths_retry.ptr & ~1, payment_id); + long ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).mapToLong(results_conv_22 -> results_conv_22 != null ? results_conv_22.ptr : 0).toArray() : null, failed_paths_retry == null ? 0 : failed_paths_retry.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32)); if (ret >= 0 && ret <= 4096) { return null; } PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/PeerHandleError.java b/src/main/java/org/ldk/structs/PeerHandleError.java index ab0f5686..42073113 100644 --- a/src/main/java/org/ldk/structs/PeerHandleError.java +++ b/src/main/java/org/ldk/structs/PeerHandleError.java @@ -49,6 +49,11 @@ public class PeerHandleError extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.PeerHandleError_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the PeerHandleError */ diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index e24a5356..7038d5b8 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -43,7 +43,7 @@ public class PeerManager extends CommonBase { * cryptographically secure random bytes. */ public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, byte[] our_node_secret, byte[] ephemeral_random_data, Logger logger, CustomMessageHandler custom_message_handler) { - long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr), our_node_secret, ephemeral_random_data, logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr); + long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr), InternalUtils.check_arr_len(our_node_secret, 32), InternalUtils.check_arr_len(ephemeral_random_data, 32), logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr); if (ret >= 0 && ret <= 4096) { return null; } PeerManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerManager(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -79,7 +79,7 @@ public class PeerManager extends CommonBase { * [`socket_disconnected()`]: PeerManager::socket_disconnected */ public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, SocketDescriptor descriptor) { - long ret = bindings.PeerManager_new_outbound_connection(this.ptr, their_node_id, descriptor == null ? 0 : descriptor.ptr); + long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor == null ? 0 : descriptor.ptr); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); this.ptrs_to.add(descriptor); @@ -189,7 +189,7 @@ public class PeerManager extends CommonBase { * [`disconnect_socket`]: SocketDescriptor::disconnect_socket */ public void disconnect_by_node_id(byte[] node_id, boolean no_connection_possible) { - bindings.PeerManager_disconnect_by_node_id(this.ptr, node_id, no_connection_possible); + bindings.PeerManager_disconnect_by_node_id(this.ptr, InternalUtils.check_arr_len(node_id, 33), no_connection_possible); } /** diff --git a/src/main/java/org/ldk/structs/Persist.java b/src/main/java/org/ldk/structs/Persist.java index 335576fc..416db9bd 100644 --- a/src/main/java/org/ldk/structs/Persist.java +++ b/src/main/java/org/ldk/structs/Persist.java @@ -110,7 +110,7 @@ public class Persist extends CommonBase { MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new MonitorUpdateId(null, update_id); } update_id_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(channel_id_hu_conv, data_hu_conv, update_id_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long update_persisted_channel(long channel_id, long update, long data, long update_id) { @@ -121,7 +121,7 @@ public class Persist extends CommonBase { MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new MonitorUpdateId(null, update_id); } update_id_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(channel_id_hu_conv, update_hu_conv, data_hu_conv, update_id_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }); diff --git a/src/main/java/org/ldk/structs/Ping.java b/src/main/java/org/ldk/structs/Ping.java index 4ef0ce5f..8212fec0 100644 --- a/src/main/java/org/ldk/structs/Ping.java +++ b/src/main/java/org/ldk/structs/Ping.java @@ -62,6 +62,11 @@ public class Ping extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.Ping_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Ping */ diff --git a/src/main/java/org/ldk/structs/Pong.java b/src/main/java/org/ldk/structs/Pong.java index 50fafe46..ac695f22 100644 --- a/src/main/java/org/ldk/structs/Pong.java +++ b/src/main/java/org/ldk/structs/Pong.java @@ -47,6 +47,11 @@ public class Pong extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.Pong_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Pong */ diff --git a/src/main/java/org/ldk/structs/PositiveTimestamp.java b/src/main/java/org/ldk/structs/PositiveTimestamp.java index 5c5e2272..3113fe77 100644 --- a/src/main/java/org/ldk/structs/PositiveTimestamp.java +++ b/src/main/java/org/ldk/structs/PositiveTimestamp.java @@ -35,6 +35,11 @@ public class PositiveTimestamp extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.PositiveTimestamp_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the PositiveTimestamp */ diff --git a/src/main/java/org/ldk/structs/PrivateRoute.java b/src/main/java/org/ldk/structs/PrivateRoute.java index a74bcc89..c4f11b6c 100644 --- a/src/main/java/org/ldk/structs/PrivateRoute.java +++ b/src/main/java/org/ldk/structs/PrivateRoute.java @@ -22,6 +22,11 @@ public class PrivateRoute extends CommonBase { if (ptr != 0) { bindings.PrivateRoute_free(ptr); } } + long clone_ptr() { + long ret = bindings.PrivateRoute_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the PrivateRoute */ diff --git a/src/main/java/org/ldk/structs/QueryChannelRange.java b/src/main/java/org/ldk/structs/QueryChannelRange.java index d249d84b..b378c84a 100644 --- a/src/main/java/org/ldk/structs/QueryChannelRange.java +++ b/src/main/java/org/ldk/structs/QueryChannelRange.java @@ -34,7 +34,7 @@ public class QueryChannelRange extends CommonBase { * The genesis hash of the blockchain being queried */ public void set_chain_hash(byte[] val) { - bindings.QueryChannelRange_set_chain_hash(this.ptr, val); + bindings.QueryChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -71,13 +71,18 @@ public class QueryChannelRange extends CommonBase { * Constructs a new QueryChannelRange given each field */ public static QueryChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg) { - long ret = bindings.QueryChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg); + long ret = bindings.QueryChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg); if (ret >= 0 && ret <= 4096) { return null; } QueryChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryChannelRange(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.QueryChannelRange_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the QueryChannelRange */ diff --git a/src/main/java/org/ldk/structs/QueryShortChannelIds.java b/src/main/java/org/ldk/structs/QueryShortChannelIds.java index 2f79a0d8..194cbc5f 100644 --- a/src/main/java/org/ldk/structs/QueryShortChannelIds.java +++ b/src/main/java/org/ldk/structs/QueryShortChannelIds.java @@ -38,7 +38,7 @@ public class QueryShortChannelIds extends CommonBase { * The genesis hash of the blockchain being queried */ public void set_chain_hash(byte[] val) { - bindings.QueryShortChannelIds_set_chain_hash(this.ptr, val); + bindings.QueryShortChannelIds_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -52,13 +52,18 @@ public class QueryShortChannelIds extends CommonBase { * Constructs a new QueryShortChannelIds given each field */ public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) { - long ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg); + long ret = bindings.QueryShortChannelIds_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_ids_arg); if (ret >= 0 && ret <= 4096) { return null; } QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryShortChannelIds(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.QueryShortChannelIds_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the QueryShortChannelIds */ diff --git a/src/main/java/org/ldk/structs/RawDataPart.java b/src/main/java/org/ldk/structs/RawDataPart.java index 4cb9a656..340fc191 100644 --- a/src/main/java/org/ldk/structs/RawDataPart.java +++ b/src/main/java/org/ldk/structs/RawDataPart.java @@ -48,6 +48,11 @@ public class RawDataPart extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.RawDataPart_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RawDataPart */ diff --git a/src/main/java/org/ldk/structs/RawInvoice.java b/src/main/java/org/ldk/structs/RawInvoice.java index 5c4a0327..00082036 100644 --- a/src/main/java/org/ldk/structs/RawInvoice.java +++ b/src/main/java/org/ldk/structs/RawInvoice.java @@ -52,6 +52,11 @@ public class RawInvoice extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.RawInvoice_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RawInvoice */ diff --git a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java index d95374da..9c3bf743 100644 --- a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java +++ b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java @@ -25,7 +25,7 @@ public class ReadOnlyNetworkGraph extends CommonBase { * or if node announcement for the node was never received. */ public Option_CVec_NetAddressZZ get_addresses(byte[] pubkey) { - long ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, pubkey); + long ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, InternalUtils.check_arr_len(pubkey, 33)); if (ret >= 0 && ret <= 4096) { return null; } Option_CVec_NetAddressZZ ret_hu_conv = Option_CVec_NetAddressZZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(this); diff --git a/src/main/java/org/ldk/structs/Record.java b/src/main/java/org/ldk/structs/Record.java new file mode 100644 index 00000000..deefa464 --- /dev/null +++ b/src/main/java/org/ldk/structs/Record.java @@ -0,0 +1,114 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + + +/** + * A Record, unit of logging output with Metadata to enable filtering + * Module_path, file, line to inform on log's source + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Record extends CommonBase { + Record(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.Record_free(ptr); } + } + + /** + * The verbosity level of the message. + */ + public Level get_level() { + Level ret = bindings.Record_get_level(this.ptr); + return ret; + } + + /** + * The verbosity level of the message. + */ + public void set_level(org.ldk.enums.Level val) { + bindings.Record_set_level(this.ptr, val); + } + + /** + * The message body. + */ + public String get_args() { + String ret = bindings.Record_get_args(this.ptr); + return ret; + } + + /** + * The message body. + */ + public void set_args(java.lang.String val) { + bindings.Record_set_args(this.ptr, val); + } + + /** + * The module path of the message. + */ + public String get_module_path() { + String ret = bindings.Record_get_module_path(this.ptr); + return ret; + } + + /** + * The module path of the message. + */ + public void set_module_path(java.lang.String val) { + bindings.Record_set_module_path(this.ptr, val); + } + + /** + * The source file containing the message. + */ + public String get_file() { + String ret = bindings.Record_get_file(this.ptr); + return ret; + } + + /** + * The source file containing the message. + */ + public void set_file(java.lang.String val) { + bindings.Record_set_file(this.ptr, val); + } + + /** + * The line containing the message. + */ + public int get_line() { + int ret = bindings.Record_get_line(this.ptr); + return ret; + } + + /** + * The line containing the message. + */ + public void set_line(int val) { + bindings.Record_set_line(this.ptr, val); + } + + long clone_ptr() { + long ret = bindings.Record_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a copy of the Record + */ + public Record clone() { + long ret = bindings.Record_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Record ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Record(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/ReplyChannelRange.java b/src/main/java/org/ldk/structs/ReplyChannelRange.java index 4f6db160..a539c890 100644 --- a/src/main/java/org/ldk/structs/ReplyChannelRange.java +++ b/src/main/java/org/ldk/structs/ReplyChannelRange.java @@ -37,7 +37,7 @@ public class ReplyChannelRange extends CommonBase { * The genesis hash of the blockchain being queried */ public void set_chain_hash(byte[] val) { - bindings.ReplyChannelRange_set_chain_hash(this.ptr, val); + bindings.ReplyChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -96,13 +96,18 @@ public class ReplyChannelRange extends CommonBase { * Constructs a new ReplyChannelRange given each field */ public static ReplyChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg) { - long ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg); + long ret = bindings.ReplyChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg); if (ret >= 0 && ret <= 4096) { return null; } ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ReplyChannelRange_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ReplyChannelRange */ diff --git a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java index 488e7dfe..8d0e5bc7 100644 --- a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java +++ b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java @@ -34,7 +34,7 @@ public class ReplyShortChannelIdsEnd extends CommonBase { * The genesis hash of the blockchain that was queried */ public void set_chain_hash(byte[] val) { - bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, val); + bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -58,13 +58,18 @@ public class ReplyShortChannelIdsEnd extends CommonBase { * Constructs a new ReplyShortChannelIdsEnd given each field */ public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, boolean full_information_arg) { - long ret = bindings.ReplyShortChannelIdsEnd_new(chain_hash_arg, full_information_arg); + long ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.check_arr_len(chain_hash_arg, 32), full_information_arg); if (ret >= 0 && ret <= 4096) { return null; } ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ReplyShortChannelIdsEnd */ diff --git a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java index 662a6bd7..747f4783 100644 --- a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { } static Result_AcceptChannelDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_AcceptChannelDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_AcceptChannelDecodeErrorZ_is_ok(ptr)) { return new Result_AcceptChannelDecodeErrorZ_OK(null, ptr); } else { return new Result_AcceptChannelDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_AcceptChannelDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java index d711f7fa..c49e049c 100644 --- a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { } static Result_AnnouncementSignaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(ptr)) { return new Result_AnnouncementSignaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_AnnouncementSignaturesDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java index 6ae3ac95..a7f81915 100644 --- a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { } static Result_BuiltCommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(ptr)) { return new Result_BuiltCommitmentTransactionDecodeErrorZ_OK(null, ptr); } else { return new Result_BuiltCommitmentTransactionDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java index 2a46ea22..c3437d05 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB } static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(ptr)) { return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(null, ptr); } else { return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(null, ptr); @@ -61,4 +61,12 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java index 19b37c50..f8542b69 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB } static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(ptr)) { return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(null, ptr); } else { return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.java index eedd7532..cb7baf31 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.java @@ -13,7 +13,7 @@ public class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends Com } static Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(ptr)) { + if (bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(ptr)) { return new Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_OK(null, ptr); } else { return new Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends Com return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java index 1cd75cd9..771b80f5 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java @@ -13,7 +13,7 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { } static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(ptr)) { + if (bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(ptr)) { return new Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_OK(null, ptr); } else { return new Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err(null, ptr); @@ -56,6 +56,19 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java new file mode 100644 index 00000000..c146dbcc --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java @@ -0,0 +1,88 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + +public class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { + private Result_COption_ClosureReasonZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_ClosureReasonZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_COption_ClosureReasonZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_ClosureReasonZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_ClosureReasonZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_ClosureReasonZDecodeErrorZ_OK extends Result_COption_ClosureReasonZDecodeErrorZ { + public final Option_ClosureReasonZ res; + private Result_COption_ClosureReasonZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_ok(ptr); + Option_ClosureReasonZ res_hu_conv = Option_ClosureReasonZ.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_COption_ClosureReasonZDecodeErrorZ_Err extends Result_COption_ClosureReasonZDecodeErrorZ { + public final DecodeError err; + private Result_COption_ClosureReasonZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state. + */ + public static Result_COption_ClosureReasonZDecodeErrorZ ok(Option_ClosureReasonZ o) { + long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_ok(o.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state. + */ + public static Result_COption_ClosureReasonZDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_ClosureReasonZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java new file mode 100644 index 00000000..daf8f8e1 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java @@ -0,0 +1,88 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + +public class Result_COption_EventZDecodeErrorZ extends CommonBase { + private Result_COption_EventZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_EventZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_COption_EventZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_EventZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_EventZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_EventZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_EventZDecodeErrorZ_OK extends Result_COption_EventZDecodeErrorZ { + public final Option_EventZ res; + private Result_COption_EventZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_COption_EventZDecodeErrorZ_get_ok(ptr); + Option_EventZ res_hu_conv = Option_EventZ.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_COption_EventZDecodeErrorZ_Err extends Result_COption_EventZDecodeErrorZ { + public final DecodeError err; + private Result_COption_EventZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_COption_EventZDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_COption_EventZDecodeErrorZ in the success state. + */ + public static Result_COption_EventZDecodeErrorZ ok(Option_EventZ o) { + long ret = bindings.CResult_COption_EventZDecodeErrorZ_ok(o.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_EventZDecodeErrorZ in the error state. + */ + public static Result_COption_EventZDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_COption_EventZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_COption_EventZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_COption_EventZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_EventZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_EventZDecodeErrorZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java new file mode 100644 index 00000000..bc311a11 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java @@ -0,0 +1,88 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + +public class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { + private Result_COption_MonitorEventZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_MonitorEventZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_COption_MonitorEventZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_MonitorEventZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_MonitorEventZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_MonitorEventZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_MonitorEventZDecodeErrorZ_OK extends Result_COption_MonitorEventZDecodeErrorZ { + public final Option_MonitorEventZ res; + private Result_COption_MonitorEventZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_COption_MonitorEventZDecodeErrorZ_get_ok(ptr); + Option_MonitorEventZ res_hu_conv = Option_MonitorEventZ.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_COption_MonitorEventZDecodeErrorZ_Err extends Result_COption_MonitorEventZDecodeErrorZ { + public final DecodeError err; + private Result_COption_MonitorEventZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state. + */ + public static Result_COption_MonitorEventZDecodeErrorZ ok(Option_MonitorEventZ o) { + long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_ok(o.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state. + */ + public static Result_COption_MonitorEventZDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_MonitorEventZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java new file mode 100644 index 00000000..e639a619 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java @@ -0,0 +1,88 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + +public class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { + private Result_COption_NetworkUpdateZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_COption_NetworkUpdateZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_NetworkUpdateZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_NetworkUpdateZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_NetworkUpdateZDecodeErrorZ_OK extends Result_COption_NetworkUpdateZDecodeErrorZ { + public final Option_NetworkUpdateZ res; + private Result_COption_NetworkUpdateZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(ptr); + Option_NetworkUpdateZ res_hu_conv = Option_NetworkUpdateZ.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_COption_NetworkUpdateZDecodeErrorZ_Err extends Result_COption_NetworkUpdateZDecodeErrorZ { + public final DecodeError err; + private Result_COption_NetworkUpdateZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state. + */ + public static Result_COption_NetworkUpdateZDecodeErrorZ ok(Option_NetworkUpdateZ o) { + long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state. + */ + public static Result_COption_NetworkUpdateZDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_COption_NetworkUpdateZDecodeErrorZ clone() { + long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java index fed124a6..80f39b53 100644 --- a/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_COption_TypeZDecodeErrorZ extends CommonBase { } static Result_COption_TypeZDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_COption_TypeZDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_COption_TypeZDecodeErrorZ_is_ok(ptr)) { return new Result_COption_TypeZDecodeErrorZ_OK(null, ptr); } else { return new Result_COption_TypeZDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_COption_TypeZDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_COption_TypeZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_COption_TypeZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.java b/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.java index a4c38586..24f20b43 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.java @@ -13,7 +13,7 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB } static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(ptr)) { + if (bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(ptr)) { return new Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_OK(null, ptr); } else { return new Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_Err(null, ptr); @@ -63,6 +63,19 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java index be1685e3..cc585451 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java @@ -13,7 +13,7 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { } static Result_CVec_CVec_u8ZZNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(ptr)) { + if (bindings.CResult_CVec_CVec_u8ZZNoneZ_is_ok(ptr)) { return new Result_CVec_CVec_u8ZZNoneZ_OK(null, ptr); } else { return new Result_CVec_CVec_u8ZZNoneZ_Err(null, ptr); @@ -53,6 +53,19 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java b/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java index 335a2d73..c5d7e856 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java @@ -13,7 +13,7 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { } static Result_CVec_SignatureZNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_SignatureZNoneZ_result_ok(ptr)) { + if (bindings.CResult_CVec_SignatureZNoneZ_is_ok(ptr)) { return new Result_CVec_SignatureZNoneZ_OK(null, ptr); } else { return new Result_CVec_SignatureZNoneZ_Err(null, ptr); @@ -37,7 +37,7 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { * Creates a new CResult_CVec_SignatureZNoneZ in the success state. */ public static Result_CVec_SignatureZNoneZ ok(byte[][] o) { - long ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o); + long ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o != null ? Arrays.stream(o).map(o_conv_8 -> InternalUtils.check_arr_len(o_conv_8, 64)).toArray(byte[][]::new) : null); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); return ret_hu_conv; @@ -53,6 +53,19 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_SignatureZNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CVec_SignatureZNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java index b8549666..b6368d74 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java @@ -13,7 +13,7 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { } static Result_CVec_u8ZPeerHandleErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(ptr)) { + if (bindings.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(ptr)) { return new Result_CVec_u8ZPeerHandleErrorZ_OK(null, ptr); } else { return new Result_CVec_u8ZPeerHandleErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java index 9cc0cb29..00d8524c 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { } static Result_ChannelAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelAnnouncementDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelAnnouncementDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelAnnouncementDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java index 005d53de..d7dd4896 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { } static Result_ChannelConfigDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelConfigDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelConfigDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelConfigDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelConfigDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelConfigDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java index 1253a8d5..01f1801e 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { } static Result_ChannelFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelFeaturesDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelFeaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelFeaturesDecodeErrorZ_Err(null, ptr); @@ -61,4 +61,12 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java index f0d5078c..6ed6b099 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { } static Result_ChannelInfoDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelInfoDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelInfoDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelInfoDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelInfoDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelInfoDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java index 2430db57..58d180a0 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { } static Result_ChannelMonitorUpdateDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelMonitorUpdateDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelMonitorUpdateDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java index 8a9d5b80..29cb5a8d 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { } static Result_ChannelPublicKeysDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelPublicKeysDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelPublicKeysDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelPublicKeysDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java index ea90e563..6363cdd0 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { } static Result_ChannelReestablishDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelReestablishDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelReestablishDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelReestablishDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelReestablishDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java index 6911dfe8..d88d316c 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase } static Result_ChannelTransactionParametersDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelTransactionParametersDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelTransactionParametersDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java index bf791411..e493a0f9 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { } static Result_ChannelUpdateDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelUpdateDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelUpdateDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelUpdateDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelUpdateDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java index f681c963..d86b25be 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { } static Result_ClosingSignedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ClosingSignedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ClosingSignedDecodeErrorZ_is_ok(ptr)) { return new Result_ClosingSignedDecodeErrorZ_OK(null, ptr); } else { return new Result_ClosingSignedDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ClosingSignedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java index deb81565..74ce2a58 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { } static Result_ClosingSignedFeeRangeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(ptr)) { return new Result_ClosingSignedFeeRangeDecodeErrorZ_OK(null, ptr); } else { return new Result_ClosingSignedFeeRangeDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java index 547e7530..b3a739d0 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { } static Result_CommitmentSignedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_CommitmentSignedDecodeErrorZ_is_ok(ptr)) { return new Result_CommitmentSignedDecodeErrorZ_OK(null, ptr); } else { return new Result_CommitmentSignedDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CommitmentSignedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java index 4048b00c..4054c0f5 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { } static Result_CommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_CommitmentTransactionDecodeErrorZ_is_ok(ptr)) { return new Result_CommitmentTransactionDecodeErrorZ_OK(null, ptr); } else { return new Result_CommitmentTransactionDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java index 33b5b2e0..f73e29ad 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends } static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(ptr)) { return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(null, ptr); } else { return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java index 04a3630c..3c88dd5f 100644 --- a/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas } static Result_DelayedPaymentOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(ptr)) { return new Result_DelayedPaymentOutputDescriptorDecodeErrorZ_OK(null, ptr); } else { return new Result_DelayedPaymentOutputDescriptorDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java index aa751e7a..96fee8f1 100644 --- a/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java @@ -13,7 +13,7 @@ public class Result_DescriptionCreationErrorZ extends CommonBase { } static Result_DescriptionCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_DescriptionCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_DescriptionCreationErrorZ_is_ok(ptr)) { return new Result_DescriptionCreationErrorZ_OK(null, ptr); } else { return new Result_DescriptionCreationErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_DescriptionCreationErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_DescriptionCreationErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_DescriptionCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java index f9bd1718..7f055233 100644 --- a/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { } static Result_DirectionalChannelInfoDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(ptr)) { return new Result_DirectionalChannelInfoDecodeErrorZ_OK(null, ptr); } else { return new Result_DirectionalChannelInfoDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java index 41212aa7..4c88b27b 100644 --- a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { } static Result_ErrorMessageDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ErrorMessageDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ErrorMessageDecodeErrorZ_is_ok(ptr)) { return new Result_ErrorMessageDecodeErrorZ_OK(null, ptr); } else { return new Result_ErrorMessageDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ErrorMessageDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ExpiryTimeCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_ExpiryTimeCreationErrorZ.java index 23c690c3..a3169a5e 100644 --- a/src/main/java/org/ldk/structs/Result_ExpiryTimeCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ExpiryTimeCreationErrorZ.java @@ -13,7 +13,7 @@ public class Result_ExpiryTimeCreationErrorZ extends CommonBase { } static Result_ExpiryTimeCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ExpiryTimeCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_ExpiryTimeCreationErrorZ_is_ok(ptr)) { return new Result_ExpiryTimeCreationErrorZ_OK(null, ptr); } else { return new Result_ExpiryTimeCreationErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_ExpiryTimeCreationErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ExpiryTimeCreationErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ExpiryTimeCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java index 719a7cea..83109a01 100644 --- a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { } static Result_FundingCreatedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_FundingCreatedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_FundingCreatedDecodeErrorZ_is_ok(ptr)) { return new Result_FundingCreatedDecodeErrorZ_OK(null, ptr); } else { return new Result_FundingCreatedDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_FundingCreatedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java index 44c159df..d53ec19c 100644 --- a/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase { } static Result_FundingLockedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_FundingLockedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_FundingLockedDecodeErrorZ_is_ok(ptr)) { return new Result_FundingLockedDecodeErrorZ_OK(null, ptr); } else { return new Result_FundingLockedDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_FundingLockedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_FundingLockedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java index 7ac9f23d..87ff66aa 100644 --- a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { } static Result_FundingSignedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_FundingSignedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_FundingSignedDecodeErrorZ_is_ok(ptr)) { return new Result_FundingSignedDecodeErrorZ_OK(null, ptr); } else { return new Result_FundingSignedDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_FundingSignedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_FundingSignedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java index ec51d555..bd2c4e86 100644 --- a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { } static Result_GossipTimestampFilterDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_GossipTimestampFilterDecodeErrorZ_is_ok(ptr)) { return new Result_GossipTimestampFilterDecodeErrorZ_OK(null, ptr); } else { return new Result_GossipTimestampFilterDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java index d568dcc9..583d06fc 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { } static Result_HTLCOutputInCommitmentDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(ptr)) { return new Result_HTLCOutputInCommitmentDecodeErrorZ_OK(null, ptr); } else { return new Result_HTLCOutputInCommitmentDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java index c4517ded..500c0748 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { } static Result_HTLCUpdateDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_HTLCUpdateDecodeErrorZ_is_ok(ptr)) { return new Result_HTLCUpdateDecodeErrorZ_OK(null, ptr); } else { return new Result_HTLCUpdateDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_HTLCUpdateDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java index 83d0205f..24829770 100644 --- a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { } static Result_HolderCommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(ptr)) { return new Result_HolderCommitmentTransactionDecodeErrorZ_OK(null, ptr); } else { return new Result_HolderCommitmentTransactionDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java index 12af3e25..7b54e4ab 100644 --- a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { } static Result_InMemorySignerDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InMemorySignerDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_InMemorySignerDecodeErrorZ_is_ok(ptr)) { return new Result_InMemorySignerDecodeErrorZ_OK(null, ptr); } else { return new Result_InMemorySignerDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_InMemorySignerDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java index fc4ba847..b13f2a6a 100644 --- a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_InitDecodeErrorZ extends CommonBase { } static Result_InitDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InitDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_InitDecodeErrorZ_is_ok(ptr)) { return new Result_InitDecodeErrorZ_OK(null, ptr); } else { return new Result_InitDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_InitDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_InitDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_InitDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java index 4ddf9e77..ba1f003a 100644 --- a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { } static Result_InitFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InitFeaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_InitFeaturesDecodeErrorZ_is_ok(ptr)) { return new Result_InitFeaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_InitFeaturesDecodeErrorZ_Err(null, ptr); @@ -61,4 +61,12 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_InitFeaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java index c18431bb..3a337bb6 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { } static Result_InvoiceFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(ptr)) { return new Result_InvoiceFeaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_InvoiceFeaturesDecodeErrorZ_Err(null, ptr); @@ -61,4 +61,12 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceNoneZ.java b/src/main/java/org/ldk/structs/Result_InvoiceNoneZ.java index 47f88366..85afc1b5 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceNoneZ.java @@ -13,7 +13,7 @@ public class Result_InvoiceNoneZ extends CommonBase { } static Result_InvoiceNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InvoiceNoneZ_result_ok(ptr)) { + if (bindings.CResult_InvoiceNoneZ_is_ok(ptr)) { return new Result_InvoiceNoneZ_OK(null, ptr); } else { return new Result_InvoiceNoneZ_Err(null, ptr); @@ -56,6 +56,19 @@ public class Result_InvoiceNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_InvoiceNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_InvoiceNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_InvoiceNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java index 6f12fb2e..cca24af0 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java @@ -13,7 +13,7 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase { } static Result_InvoiceSemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InvoiceSemanticErrorZ_result_ok(ptr)) { + if (bindings.CResult_InvoiceSemanticErrorZ_is_ok(ptr)) { return new Result_InvoiceSemanticErrorZ_OK(null, ptr); } else { return new Result_InvoiceSemanticErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_InvoiceSemanticErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_InvoiceSemanticErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java index c41442aa..c61e1e4d 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java @@ -13,7 +13,7 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase { } static Result_InvoiceSignOrCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InvoiceSignOrCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_InvoiceSignOrCreationErrorZ_is_ok(ptr)) { return new Result_InvoiceSignOrCreationErrorZ_OK(null, ptr); } else { return new Result_InvoiceSignOrCreationErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_InvoiceSignOrCreationErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java b/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java index eaa3e195..43e36b85 100644 --- a/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java @@ -13,7 +13,7 @@ public class Result_LockedChannelMonitorNoneZ extends CommonBase { } static Result_LockedChannelMonitorNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_LockedChannelMonitorNoneZ_result_ok(ptr)) { + if (bindings.CResult_LockedChannelMonitorNoneZ_is_ok(ptr)) { return new Result_LockedChannelMonitorNoneZ_OK(null, ptr); } else { return new Result_LockedChannelMonitorNoneZ_Err(null, ptr); @@ -65,4 +65,12 @@ public class Result_LockedChannelMonitorNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_LockedChannelMonitorNoneZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java index e76b856e..17eafe88 100644 --- a/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase { } static Result_NetAddressDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NetAddressDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NetAddressDecodeErrorZ_is_ok(ptr)) { return new Result_NetAddressDecodeErrorZ_OK(null, ptr); } else { return new Result_NetAddressDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NetAddressDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NetAddressDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java index edfb2b96..57286ccc 100644 --- a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { } static Result_NetworkGraphDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NetworkGraphDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NetworkGraphDecodeErrorZ_is_ok(ptr)) { return new Result_NetworkGraphDecodeErrorZ_OK(null, ptr); } else { return new Result_NetworkGraphDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NetworkGraphDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java index 8687041a..20cae360 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { } static Result_NodeAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeAnnouncementDecodeErrorZ_is_ok(ptr)) { return new Result_NodeAnnouncementDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeAnnouncementDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java index 399ce624..877b7f19 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { } static Result_NodeAnnouncementInfoDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(ptr)) { return new Result_NodeAnnouncementInfoDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeAnnouncementInfoDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java index 67a831a1..f121e124 100644 --- a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { } static Result_NodeFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeFeaturesDecodeErrorZ_is_ok(ptr)) { return new Result_NodeFeaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeFeaturesDecodeErrorZ_Err(null, ptr); @@ -61,4 +61,12 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NodeFeaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java index cffb4e58..ab1c2843 100644 --- a/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { } static Result_NodeIdDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeIdDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeIdDecodeErrorZ_is_ok(ptr)) { return new Result_NodeIdDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeIdDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NodeIdDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NodeIdDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java index 94e63ac7..b8330673 100644 --- a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { } static Result_NodeInfoDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeInfoDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeInfoDecodeErrorZ_is_ok(ptr)) { return new Result_NodeInfoDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeInfoDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NodeInfoDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NodeInfoDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java index 60669eea..64977a26 100644 --- a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java @@ -13,7 +13,7 @@ public class Result_NoneAPIErrorZ extends CommonBase { } static Result_NoneAPIErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneAPIErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneAPIErrorZ_is_ok(ptr)) { return new Result_NoneAPIErrorZ_OK(null, ptr); } else { return new Result_NoneAPIErrorZ_Err(null, ptr); @@ -56,6 +56,19 @@ public class Result_NoneAPIErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneAPIErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneAPIErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java b/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java index 7059e037..d8bfde24 100644 --- a/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java @@ -13,7 +13,7 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { } static Result_NoneChannelMonitorUpdateErrZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(ptr)) { + if (bindings.CResult_NoneChannelMonitorUpdateErrZ_is_ok(ptr)) { return new Result_NoneChannelMonitorUpdateErrZ_OK(null, ptr); } else { return new Result_NoneChannelMonitorUpdateErrZ_Err(null, ptr); @@ -53,6 +53,19 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NoneErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneErrorZ.java index d9b7cf49..a2fc3b4b 100644 --- a/src/main/java/org/ldk/structs/Result_NoneErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneErrorZ.java @@ -13,7 +13,7 @@ public class Result_NoneErrorZ extends CommonBase { } static Result_NoneErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneErrorZ_is_ok(ptr)) { return new Result_NoneErrorZ_OK(null, ptr); } else { return new Result_NoneErrorZ_Err(null, ptr); @@ -53,6 +53,19 @@ public class Result_NoneErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NoneErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java index 7852ba30..0e8624d8 100644 --- a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java @@ -13,7 +13,7 @@ public class Result_NoneLightningErrorZ extends CommonBase { } static Result_NoneLightningErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneLightningErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneLightningErrorZ_is_ok(ptr)) { return new Result_NoneLightningErrorZ_OK(null, ptr); } else { return new Result_NoneLightningErrorZ_Err(null, ptr); @@ -56,6 +56,19 @@ public class Result_NoneLightningErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneLightningErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneLightningErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java index 6a8556b6..afc833ae 100644 --- a/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java @@ -13,7 +13,7 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { } static Result_NoneMonitorUpdateErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneMonitorUpdateErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneMonitorUpdateErrorZ_is_ok(ptr)) { return new Result_NoneMonitorUpdateErrorZ_OK(null, ptr); } else { return new Result_NoneMonitorUpdateErrorZ_Err(null, ptr); @@ -56,6 +56,19 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneMonitorUpdateErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NoneNoneZ.java b/src/main/java/org/ldk/structs/Result_NoneNoneZ.java index 3ef1d959..3251bb95 100644 --- a/src/main/java/org/ldk/structs/Result_NoneNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneNoneZ.java @@ -13,7 +13,7 @@ public class Result_NoneNoneZ extends CommonBase { } static Result_NoneNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneNoneZ_result_ok(ptr)) { + if (bindings.CResult_NoneNoneZ_is_ok(ptr)) { return new Result_NoneNoneZ_OK(null, ptr); } else { return new Result_NoneNoneZ_Err(null, ptr); @@ -51,6 +51,19 @@ public class Result_NoneNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NoneNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java index 9c98c599..40587621 100644 --- a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java @@ -13,7 +13,7 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { } static Result_NonePaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NonePaymentSendFailureZ_result_ok(ptr)) { + if (bindings.CResult_NonePaymentSendFailureZ_is_ok(ptr)) { return new Result_NonePaymentSendFailureZ_OK(null, ptr); } else { return new Result_NonePaymentSendFailureZ_Err(null, ptr); @@ -56,6 +56,19 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NonePaymentSendFailureZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NonePaymentSendFailureZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java index b6a2804a..643cd7f5 100644 --- a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java @@ -13,7 +13,7 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { } static Result_NonePeerHandleErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NonePeerHandleErrorZ_result_ok(ptr)) { + if (bindings.CResult_NonePeerHandleErrorZ_is_ok(ptr)) { return new Result_NonePeerHandleErrorZ_OK(null, ptr); } else { return new Result_NonePeerHandleErrorZ_Err(null, ptr); @@ -56,6 +56,19 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NonePeerHandleErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NonePeerHandleErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java index cf56e217..3d95a8b5 100644 --- a/src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java @@ -13,7 +13,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase { } static Result_NoneSemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneSemanticErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneSemanticErrorZ_is_ok(ptr)) { return new Result_NoneSemanticErrorZ_OK(null, ptr); } else { return new Result_NoneSemanticErrorZ_Err(null, ptr); @@ -53,6 +53,19 @@ public class Result_NoneSemanticErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_NoneSemanticErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NoneSemanticErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java index fd4d8c6d..5586590f 100644 --- a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { } static Result_OpenChannelDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_OpenChannelDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_OpenChannelDecodeErrorZ_is_ok(ptr)) { return new Result_OpenChannelDecodeErrorZ_OK(null, ptr); } else { return new Result_OpenChannelDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_OpenChannelDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_OpenChannelDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java index d430d70d..9ec86cd3 100644 --- a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { } static Result_OutPointDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_OutPointDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_OutPointDecodeErrorZ_is_ok(ptr)) { return new Result_OutPointDecodeErrorZ_OK(null, ptr); } else { return new Result_OutPointDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_OutPointDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_OutPointDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PayeeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PayeeDecodeErrorZ.java index 80292af0..8104e4c6 100644 --- a/src/main/java/org/ldk/structs/Result_PayeeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PayeeDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_PayeeDecodeErrorZ extends CommonBase { } static Result_PayeeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PayeeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_PayeeDecodeErrorZ_is_ok(ptr)) { return new Result_PayeeDecodeErrorZ_OK(null, ptr); } else { return new Result_PayeeDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_PayeeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PayeeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PayeeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PayeeDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java index ecf856d7..91ee0fcb 100644 --- a/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java @@ -13,7 +13,7 @@ public class Result_PayeePubKeyErrorZ extends CommonBase { } static Result_PayeePubKeyErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PayeePubKeyErrorZ_result_ok(ptr)) { + if (bindings.CResult_PayeePubKeyErrorZ_is_ok(ptr)) { return new Result_PayeePubKeyErrorZ_OK(null, ptr); } else { return new Result_PayeePubKeyErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_PayeePubKeyErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PayeePubKeyErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PayeePubKeyErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PaymentIdPaymentErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentIdPaymentErrorZ.java index 5791e39d..129508d3 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentIdPaymentErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentIdPaymentErrorZ.java @@ -13,7 +13,7 @@ public class Result_PaymentIdPaymentErrorZ extends CommonBase { } static Result_PaymentIdPaymentErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PaymentIdPaymentErrorZ_result_ok(ptr)) { + if (bindings.CResult_PaymentIdPaymentErrorZ_is_ok(ptr)) { return new Result_PaymentIdPaymentErrorZ_OK(null, ptr); } else { return new Result_PaymentIdPaymentErrorZ_Err(null, ptr); @@ -42,7 +42,7 @@ public class Result_PaymentIdPaymentErrorZ extends CommonBase { * Creates a new CResult_PaymentIdPaymentErrorZ in the success state. */ public static Result_PaymentIdPaymentErrorZ ok(byte[] o) { - long ret = bindings.CResult_PaymentIdPaymentErrorZ_ok(o); + long ret = bindings.CResult_PaymentIdPaymentErrorZ_ok(InternalUtils.check_arr_len(o, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -58,6 +58,19 @@ public class Result_PaymentIdPaymentErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PaymentIdPaymentErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PaymentIdPaymentErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PaymentIdPaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_PaymentIdPaymentSendFailureZ.java index 0b10cf21..eb0e9267 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentIdPaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentIdPaymentSendFailureZ.java @@ -13,7 +13,7 @@ public class Result_PaymentIdPaymentSendFailureZ extends CommonBase { } static Result_PaymentIdPaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(ptr)) { + if (bindings.CResult_PaymentIdPaymentSendFailureZ_is_ok(ptr)) { return new Result_PaymentIdPaymentSendFailureZ_OK(null, ptr); } else { return new Result_PaymentIdPaymentSendFailureZ_Err(null, ptr); @@ -42,7 +42,7 @@ public class Result_PaymentIdPaymentSendFailureZ extends CommonBase { * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state. */ public static Result_PaymentIdPaymentSendFailureZ ok(byte[] o) { - long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(o); + long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(InternalUtils.check_arr_len(o, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; @@ -58,6 +58,19 @@ public class Result_PaymentIdPaymentSendFailureZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PaymentIdPaymentSendFailureZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java index 2c5e9893..0cd424f6 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java @@ -13,7 +13,7 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase { } static Result_PaymentSecretAPIErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PaymentSecretAPIErrorZ_result_ok(ptr)) { + if (bindings.CResult_PaymentSecretAPIErrorZ_is_ok(ptr)) { return new Result_PaymentSecretAPIErrorZ_OK(null, ptr); } else { return new Result_PaymentSecretAPIErrorZ_Err(null, ptr); @@ -42,7 +42,7 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase { * Creates a new CResult_PaymentSecretAPIErrorZ in the success state. */ public static Result_PaymentSecretAPIErrorZ ok(byte[] o) { - long ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(o); + long ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(InternalUtils.check_arr_len(o, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -58,6 +58,19 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PaymentSecretAPIErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PaymentSecretAPIErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java index ed654d03..52aa0f46 100644 --- a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_PingDecodeErrorZ extends CommonBase { } static Result_PingDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PingDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_PingDecodeErrorZ_is_ok(ptr)) { return new Result_PingDecodeErrorZ_OK(null, ptr); } else { return new Result_PingDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_PingDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PingDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PingDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java index 53273031..9953acb9 100644 --- a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_PongDecodeErrorZ extends CommonBase { } static Result_PongDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PongDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_PongDecodeErrorZ_is_ok(ptr)) { return new Result_PongDecodeErrorZ_OK(null, ptr); } else { return new Result_PongDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_PongDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PongDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PongDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java index 344ca77e..f4648168 100644 --- a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java @@ -13,7 +13,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { } static Result_PositiveTimestampCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PositiveTimestampCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_PositiveTimestampCreationErrorZ_is_ok(ptr)) { return new Result_PositiveTimestampCreationErrorZ_OK(null, ptr); } else { return new Result_PositiveTimestampCreationErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PositiveTimestampCreationErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java index 8704ce8b..a3e25fc0 100644 --- a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java @@ -13,7 +13,7 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase { } static Result_PrivateRouteCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PrivateRouteCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_PrivateRouteCreationErrorZ_is_ok(ptr)) { return new Result_PrivateRouteCreationErrorZ_OK(null, ptr); } else { return new Result_PrivateRouteCreationErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PrivateRouteCreationErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PrivateRouteCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java index 1377bcbc..050a9e4e 100644 --- a/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java @@ -13,7 +13,7 @@ public class Result_PublicKeyErrorZ extends CommonBase { } static Result_PublicKeyErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PublicKeyErrorZ_result_ok(ptr)) { + if (bindings.CResult_PublicKeyErrorZ_is_ok(ptr)) { return new Result_PublicKeyErrorZ_OK(null, ptr); } else { return new Result_PublicKeyErrorZ_Err(null, ptr); @@ -39,7 +39,7 @@ public class Result_PublicKeyErrorZ extends CommonBase { * Creates a new CResult_PublicKeyErrorZ in the success state. */ public static Result_PublicKeyErrorZ ok(byte[] o) { - long ret = bindings.CResult_PublicKeyErrorZ_ok(o); + long ret = bindings.CResult_PublicKeyErrorZ_ok(InternalUtils.check_arr_len(o, 33)); if (ret >= 0 && ret <= 4096) { return null; } Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -55,6 +55,19 @@ public class Result_PublicKeyErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_PublicKeyErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PublicKeyErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java index b141a0ad..3e33eec2 100644 --- a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { } static Result_QueryChannelRangeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_QueryChannelRangeDecodeErrorZ_is_ok(ptr)) { return new Result_QueryChannelRangeDecodeErrorZ_OK(null, ptr); } else { return new Result_QueryChannelRangeDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java index 1844c8a3..73c3b007 100644 --- a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { } static Result_QueryShortChannelIdsDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(ptr)) { return new Result_QueryShortChannelIdsDecodeErrorZ_OK(null, ptr); } else { return new Result_QueryShortChannelIdsDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RecoverableSignatureNoneZ.java b/src/main/java/org/ldk/structs/Result_RecoverableSignatureNoneZ.java index 29b5001f..6f722b78 100644 --- a/src/main/java/org/ldk/structs/Result_RecoverableSignatureNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_RecoverableSignatureNoneZ.java @@ -13,7 +13,7 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase { } static Result_RecoverableSignatureNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RecoverableSignatureNoneZ_result_ok(ptr)) { + if (bindings.CResult_RecoverableSignatureNoneZ_is_ok(ptr)) { return new Result_RecoverableSignatureNoneZ_OK(null, ptr); } else { return new Result_RecoverableSignatureNoneZ_Err(null, ptr); @@ -37,7 +37,7 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase { * Creates a new CResult_RecoverableSignatureNoneZ in the success state. */ public static Result_RecoverableSignatureNoneZ ok(byte[] arg) { - long ret = bindings.CResult_RecoverableSignatureNoneZ_ok(arg); + long ret = bindings.CResult_RecoverableSignatureNoneZ_ok(InternalUtils.check_arr_len(arg, 68)); if (ret >= 0 && ret <= 4096) { return null; } Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; @@ -53,6 +53,19 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RecoverableSignatureNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RecoverableSignatureNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java index 3f7b4e2c..e0a5bcbc 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { } static Result_ReplyChannelRangeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ReplyChannelRangeDecodeErrorZ_is_ok(ptr)) { return new Result_ReplyChannelRangeDecodeErrorZ_OK(null, ptr); } else { return new Result_ReplyChannelRangeDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java index bba33380..6aaa8a86 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { } static Result_ReplyShortChannelIdsEndDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(ptr)) { return new Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(null, ptr); } else { return new Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java index 679192de..c165de27 100644 --- a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { } static Result_RevokeAndACKDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RevokeAndACKDecodeErrorZ_is_ok(ptr)) { return new Result_RevokeAndACKDecodeErrorZ_OK(null, ptr); } else { return new Result_RevokeAndACKDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RevokeAndACKDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java index f3248f06..d78650fb 100644 --- a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase { } static Result_RouteDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteDecodeErrorZ_is_ok(ptr)) { return new Result_RouteDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_RouteDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RouteDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RouteDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java index 37d44ea3..6c037eca 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { } static Result_RouteHintDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteHintDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteHintDecodeErrorZ_is_ok(ptr)) { return new Result_RouteHintDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteHintDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RouteHintDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RouteHintDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java index ed9fe14e..bb1179fd 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { } static Result_RouteHintHopDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteHintHopDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteHintHopDecodeErrorZ_is_ok(ptr)) { return new Result_RouteHintHopDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteHintHopDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RouteHintHopDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RouteHintHopDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java index 32c894e5..5abe5f5f 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { } static Result_RouteHopDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteHopDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteHopDecodeErrorZ_is_ok(ptr)) { return new Result_RouteHopDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteHopDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RouteHopDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RouteHopDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java index ce8e67bc..62130b7f 100644 --- a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java @@ -13,7 +13,7 @@ public class Result_RouteLightningErrorZ extends CommonBase { } static Result_RouteLightningErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteLightningErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteLightningErrorZ_is_ok(ptr)) { return new Result_RouteLightningErrorZ_OK(null, ptr); } else { return new Result_RouteLightningErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_RouteLightningErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RouteLightningErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RouteLightningErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java index aa19d4a8..0fb8e161 100644 --- a/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { } static Result_RouteParametersDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteParametersDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteParametersDecodeErrorZ_is_ok(ptr)) { return new Result_RouteParametersDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteParametersDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RouteParametersDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RouteParametersDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java index 8f691df2..0cc7fdc6 100644 --- a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { } static Result_RoutingFeesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RoutingFeesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RoutingFeesDecodeErrorZ_is_ok(ptr)) { return new Result_RoutingFeesDecodeErrorZ_OK(null, ptr); } else { return new Result_RoutingFeesDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_RoutingFeesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ScorerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ScorerDecodeErrorZ.java new file mode 100644 index 00000000..9ffe1d69 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ScorerDecodeErrorZ.java @@ -0,0 +1,81 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + +public class Result_ScorerDecodeErrorZ extends CommonBase { + private Result_ScorerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ScorerDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ScorerDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ScorerDecodeErrorZ_is_ok(ptr)) { + return new Result_ScorerDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ScorerDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ScorerDecodeErrorZ_OK extends Result_ScorerDecodeErrorZ { + public final Scorer res; + private Result_ScorerDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_ScorerDecodeErrorZ_get_ok(ptr); + Scorer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Scorer(null, res); } + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_ScorerDecodeErrorZ_Err extends Result_ScorerDecodeErrorZ { + public final DecodeError err; + private Result_ScorerDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_ScorerDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_ScorerDecodeErrorZ in the success state. + */ + public static Result_ScorerDecodeErrorZ ok(ScoringParameters o_params) { + long ret = bindings.CResult_ScorerDecodeErrorZ_ok(bindings.Scorer_new(o_params == null ? 0 : o_params.ptr & ~1)); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o_params); +// Due to rust's strict-ownership memory model, in some cases we need to "move" +// an object to pass exclusive ownership to the function being called. +// In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object +// at the FFI layer, creating a new object which Rust can claim ownership of +// However, in some cases (eg here), there is no way to clone an object, and thus +// we actually have to pass full ownership to Rust. +// Thus, after ret_hu_conv call, o_params is reset to null and is now a dummy object. +o_params.ptr = 0; + return ret_hu_conv; + } + + /** + * Creates a new CResult_ScorerDecodeErrorZ in the error state. + */ + public static Result_ScorerDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_ScorerDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ScorerDecodeErrorZ_is_ok(this.ptr); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_ScoringParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ScoringParametersDecodeErrorZ.java new file mode 100644 index 00000000..fc7ca0c4 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ScoringParametersDecodeErrorZ.java @@ -0,0 +1,72 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import javax.annotation.Nullable; + +public class Result_ScoringParametersDecodeErrorZ extends CommonBase { + private Result_ScoringParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ScoringParametersDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ScoringParametersDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ScoringParametersDecodeErrorZ_is_ok(ptr)) { + return new Result_ScoringParametersDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ScoringParametersDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ScoringParametersDecodeErrorZ_OK extends Result_ScoringParametersDecodeErrorZ { + public final ScoringParameters res; + private Result_ScoringParametersDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.LDKCResult_ScoringParametersDecodeErrorZ_get_ok(ptr); + ScoringParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ScoringParameters(null, res); } + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_ScoringParametersDecodeErrorZ_Err extends Result_ScoringParametersDecodeErrorZ { + public final DecodeError err; + private Result_ScoringParametersDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.LDKCResult_ScoringParametersDecodeErrorZ_get_err(ptr); + DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_ScoringParametersDecodeErrorZ in the success state. + */ + public static Result_ScoringParametersDecodeErrorZ ok(long o_base_penalty_msat_arg, long o_failure_penalty_msat_arg, long o_failure_penalty_half_life_arg) { + long ret = bindings.CResult_ScoringParametersDecodeErrorZ_ok(bindings.ScoringParameters_new(o_base_penalty_msat_arg, o_failure_penalty_msat_arg, o_failure_penalty_half_life_arg)); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ScoringParametersDecodeErrorZ in the error state. + */ + public static Result_ScoringParametersDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_ScoringParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ScoringParametersDecodeErrorZ_is_ok(this.ptr); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java index e310f547..f0aeae17 100644 --- a/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java @@ -13,7 +13,7 @@ public class Result_SecretKeyErrorZ extends CommonBase { } static Result_SecretKeyErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SecretKeyErrorZ_result_ok(ptr)) { + if (bindings.CResult_SecretKeyErrorZ_is_ok(ptr)) { return new Result_SecretKeyErrorZ_OK(null, ptr); } else { return new Result_SecretKeyErrorZ_Err(null, ptr); @@ -39,7 +39,7 @@ public class Result_SecretKeyErrorZ extends CommonBase { * Creates a new CResult_SecretKeyErrorZ in the success state. */ public static Result_SecretKeyErrorZ ok(byte[] o) { - long ret = bindings.CResult_SecretKeyErrorZ_ok(o); + long ret = bindings.CResult_SecretKeyErrorZ_ok(InternalUtils.check_arr_len(o, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -55,4 +55,12 @@ public class Result_SecretKeyErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_SecretKeyErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java index cee6aa8a..9e0fc29b 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { } static Result_ShutdownDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ShutdownDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ShutdownDecodeErrorZ_is_ok(ptr)) { return new Result_ShutdownDecodeErrorZ_OK(null, ptr); } else { return new Result_ShutdownDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ShutdownDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ShutdownDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java index 96b1412e..5bf4fcb6 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { } static Result_ShutdownScriptDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ShutdownScriptDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ShutdownScriptDecodeErrorZ_is_ok(ptr)) { return new Result_ShutdownScriptDecodeErrorZ_OK(null, ptr); } else { return new Result_ShutdownScriptDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ShutdownScriptDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java index 420b036d..4a51de00 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java @@ -13,7 +13,7 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { } static Result_ShutdownScriptInvalidShutdownScriptZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(ptr)) { + if (bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(ptr)) { return new Result_ShutdownScriptInvalidShutdownScriptZ_OK(null, ptr); } else { return new Result_ShutdownScriptInvalidShutdownScriptZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_SiPrefixNoneZ.java b/src/main/java/org/ldk/structs/Result_SiPrefixNoneZ.java index 0cd22a38..0454d7a8 100644 --- a/src/main/java/org/ldk/structs/Result_SiPrefixNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_SiPrefixNoneZ.java @@ -13,7 +13,7 @@ public class Result_SiPrefixNoneZ extends CommonBase { } static Result_SiPrefixNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SiPrefixNoneZ_result_ok(ptr)) { + if (bindings.CResult_SiPrefixNoneZ_is_ok(ptr)) { return new Result_SiPrefixNoneZ_OK(null, ptr); } else { return new Result_SiPrefixNoneZ_Err(null, ptr); @@ -53,6 +53,19 @@ public class Result_SiPrefixNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_SiPrefixNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_SiPrefixNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java index 75cf6d78..9f8eda0b 100644 --- a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_SignDecodeErrorZ extends CommonBase { } static Result_SignDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SignDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_SignDecodeErrorZ_is_ok(ptr)) { return new Result_SignDecodeErrorZ_OK(null, ptr); } else { return new Result_SignDecodeErrorZ_Err(null, ptr); @@ -62,6 +62,19 @@ public class Result_SignDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_SignDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_SignDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java b/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java index 5145441b..061b1e22 100644 --- a/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_SignatureNoneZ.java @@ -13,7 +13,7 @@ public class Result_SignatureNoneZ extends CommonBase { } static Result_SignatureNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SignatureNoneZ_result_ok(ptr)) { + if (bindings.CResult_SignatureNoneZ_is_ok(ptr)) { return new Result_SignatureNoneZ_OK(null, ptr); } else { return new Result_SignatureNoneZ_Err(null, ptr); @@ -37,7 +37,7 @@ public class Result_SignatureNoneZ extends CommonBase { * Creates a new CResult_SignatureNoneZ in the success state. */ public static Result_SignatureNoneZ ok(byte[] o) { - long ret = bindings.CResult_SignatureNoneZ_ok(o); + long ret = bindings.CResult_SignatureNoneZ_ok(InternalUtils.check_arr_len(o, 64)); if (ret >= 0 && ret <= 4096) { return null; } Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; @@ -53,6 +53,19 @@ public class Result_SignatureNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_SignatureNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_SignatureNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_SignatureNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_SignedRawInvoiceNoneZ.java b/src/main/java/org/ldk/structs/Result_SignedRawInvoiceNoneZ.java index 765bca5d..0f41d984 100644 --- a/src/main/java/org/ldk/structs/Result_SignedRawInvoiceNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_SignedRawInvoiceNoneZ.java @@ -13,7 +13,7 @@ public class Result_SignedRawInvoiceNoneZ extends CommonBase { } static Result_SignedRawInvoiceNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SignedRawInvoiceNoneZ_result_ok(ptr)) { + if (bindings.CResult_SignedRawInvoiceNoneZ_is_ok(ptr)) { return new Result_SignedRawInvoiceNoneZ_OK(null, ptr); } else { return new Result_SignedRawInvoiceNoneZ_Err(null, ptr); @@ -56,6 +56,19 @@ public class Result_SignedRawInvoiceNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_SignedRawInvoiceNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_SignedRawInvoiceNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java index 64f55536..be931316 100644 --- a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { } static Result_SpendableOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(ptr)) { return new Result_SpendableOutputDescriptorDecodeErrorZ_OK(null, ptr); } else { return new Result_SpendableOutputDescriptorDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java index 442ef14f..c0a4efdb 100644 --- a/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase } static Result_StaticPaymentOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(ptr)) { return new Result_StaticPaymentOutputDescriptorDecodeErrorZ_OK(null, ptr); } else { return new Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_StringErrorZ.java b/src/main/java/org/ldk/structs/Result_StringErrorZ.java index a9ef3776..92a7c2a5 100644 --- a/src/main/java/org/ldk/structs/Result_StringErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_StringErrorZ.java @@ -13,7 +13,7 @@ public class Result_StringErrorZ extends CommonBase { } static Result_StringErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_StringErrorZ_result_ok(ptr)) { + if (bindings.CResult_StringErrorZ_is_ok(ptr)) { return new Result_StringErrorZ_OK(null, ptr); } else { return new Result_StringErrorZ_Err(null, ptr); @@ -55,4 +55,12 @@ public class Result_StringErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_StringErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java index de1757aa..792e4eb2 100644 --- a/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TransactionNoneZ.java @@ -13,7 +13,7 @@ public class Result_TransactionNoneZ extends CommonBase { } static Result_TransactionNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TransactionNoneZ_result_ok(ptr)) { + if (bindings.CResult_TransactionNoneZ_is_ok(ptr)) { return new Result_TransactionNoneZ_OK(null, ptr); } else { return new Result_TransactionNoneZ_Err(null, ptr); @@ -53,6 +53,19 @@ public class Result_TransactionNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_TransactionNoneZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_TransactionNoneZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_TransactionNoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java index 814f7e99..0f444d5c 100644 --- a/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java @@ -13,7 +13,7 @@ public class Result_TrustedClosingTransactionNoneZ extends CommonBase { } static Result_TrustedClosingTransactionNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TrustedClosingTransactionNoneZ_result_ok(ptr)) { + if (bindings.CResult_TrustedClosingTransactionNoneZ_is_ok(ptr)) { return new Result_TrustedClosingTransactionNoneZ_OK(null, ptr); } else { return new Result_TrustedClosingTransactionNoneZ_Err(null, ptr); @@ -65,4 +65,12 @@ public class Result_TrustedClosingTransactionNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_TrustedClosingTransactionNoneZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java index 3beed26a..fdf1d8b1 100644 --- a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java @@ -13,7 +13,7 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { } static Result_TrustedCommitmentTransactionNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(ptr)) { + if (bindings.CResult_TrustedCommitmentTransactionNoneZ_is_ok(ptr)) { return new Result_TrustedCommitmentTransactionNoneZ_OK(null, ptr); } else { return new Result_TrustedCommitmentTransactionNoneZ_Err(null, ptr); @@ -65,4 +65,12 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_is_ok(this.ptr); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java index 1ec67279..deba6a76 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { } static Result_TxCreationKeysDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TxCreationKeysDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_TxCreationKeysDecodeErrorZ_is_ok(ptr)) { return new Result_TxCreationKeysDecodeErrorZ_OK(null, ptr); } else { return new Result_TxCreationKeysDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_TxCreationKeysDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java index 564219ef..1ed03f74 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java @@ -13,7 +13,7 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { } static Result_TxCreationKeysErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TxCreationKeysErrorZ_result_ok(ptr)) { + if (bindings.CResult_TxCreationKeysErrorZ_is_ok(ptr)) { return new Result_TxCreationKeysErrorZ_OK(null, ptr); } else { return new Result_TxCreationKeysErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_TxCreationKeysErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_TxCreationKeysErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java b/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java index 98ff1b53..3c9f47ef 100644 --- a/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java @@ -13,7 +13,7 @@ public class Result_TxOutAccessErrorZ extends CommonBase { } static Result_TxOutAccessErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TxOutAccessErrorZ_result_ok(ptr)) { + if (bindings.CResult_TxOutAccessErrorZ_is_ok(ptr)) { return new Result_TxOutAccessErrorZ_OK(null, ptr); } else { return new Result_TxOutAccessErrorZ_Err(null, ptr); @@ -57,6 +57,19 @@ public class Result_TxOutAccessErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_TxOutAccessErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_TxOutAccessErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java index fe6e0b18..715ab33a 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { } static Result_UnsignedChannelAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(ptr)) { return new Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(null, ptr); } else { return new Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java index f3d60337..9f43f1c0 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { } static Result_UnsignedChannelUpdateDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(ptr)) { return new Result_UnsignedChannelUpdateDecodeErrorZ_OK(null, ptr); } else { return new Result_UnsignedChannelUpdateDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java index 872d4cf3..2abc39ee 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { } static Result_UnsignedNodeAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(ptr)) { return new Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(null, ptr); } else { return new Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java index d76ab972..d6a723d4 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { } static Result_UpdateAddHTLCDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateAddHTLCDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateAddHTLCDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateAddHTLCDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java index aaa91edb..bb368b9b 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { } static Result_UpdateFailHTLCDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateFailHTLCDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateFailHTLCDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateFailHTLCDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java index bbbd6802..38f3f13a 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { } static Result_UpdateFailMalformedHTLCDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java index 57ad2603..92e95a43 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { } static Result_UpdateFeeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateFeeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateFeeDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateFeeDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateFeeDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateFeeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java index 2f6e05b0..a282998a 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java @@ -13,7 +13,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { } static Result_UpdateFulfillHTLCDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateFulfillHTLCDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateFulfillHTLCDecodeErrorZ_Err(null, ptr); @@ -61,6 +61,19 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result__u832APIErrorZ.java b/src/main/java/org/ldk/structs/Result__u832APIErrorZ.java index 46a091aa..c3473d2a 100644 --- a/src/main/java/org/ldk/structs/Result__u832APIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result__u832APIErrorZ.java @@ -13,7 +13,7 @@ public class Result__u832APIErrorZ extends CommonBase { } static Result__u832APIErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult__u832APIErrorZ_result_ok(ptr)) { + if (bindings.CResult__u832APIErrorZ_is_ok(ptr)) { return new Result__u832APIErrorZ_OK(null, ptr); } else { return new Result__u832APIErrorZ_Err(null, ptr); @@ -42,7 +42,7 @@ public class Result__u832APIErrorZ extends CommonBase { * Creates a new CResult__u832APIErrorZ in the success state. */ public static Result__u832APIErrorZ ok(byte[] o) { - long ret = bindings.CResult__u832APIErrorZ_ok(o); + long ret = bindings.CResult__u832APIErrorZ_ok(InternalUtils.check_arr_len(o, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -58,6 +58,19 @@ public class Result__u832APIErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult__u832APIErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult__u832APIErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult__u832APIErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java index b2d4b190..6def50e3 100644 --- a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java @@ -13,7 +13,7 @@ public class Result_boolLightningErrorZ extends CommonBase { } static Result_boolLightningErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_boolLightningErrorZ_result_ok(ptr)) { + if (bindings.CResult_boolLightningErrorZ_is_ok(ptr)) { return new Result_boolLightningErrorZ_OK(null, ptr); } else { return new Result_boolLightningErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_boolLightningErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_boolLightningErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_boolLightningErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_boolLightningErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java index d6c64887..b409c2f7 100644 --- a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java @@ -13,7 +13,7 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { } static Result_boolPeerHandleErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_boolPeerHandleErrorZ_result_ok(ptr)) { + if (bindings.CResult_boolPeerHandleErrorZ_is_ok(ptr)) { return new Result_boolPeerHandleErrorZ_OK(null, ptr); } else { return new Result_boolPeerHandleErrorZ_Err(null, ptr); @@ -58,6 +58,19 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_boolPeerHandleErrorZ_is_ok(this.ptr); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_boolPeerHandleErrorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/RetryAttempts.java b/src/main/java/org/ldk/structs/RetryAttempts.java index fd1eb215..af587789 100644 --- a/src/main/java/org/ldk/structs/RetryAttempts.java +++ b/src/main/java/org/ldk/structs/RetryAttempts.java @@ -43,6 +43,11 @@ public class RetryAttempts extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.RetryAttempts_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RetryAttempts */ diff --git a/src/main/java/org/ldk/structs/RevokeAndACK.java b/src/main/java/org/ldk/structs/RevokeAndACK.java index 8ab6e5b7..dc58cb4e 100644 --- a/src/main/java/org/ldk/structs/RevokeAndACK.java +++ b/src/main/java/org/ldk/structs/RevokeAndACK.java @@ -31,7 +31,7 @@ public class RevokeAndACK extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.RevokeAndACK_set_channel_id(this.ptr, val); + bindings.RevokeAndACK_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -46,7 +46,7 @@ public class RevokeAndACK extends CommonBase { * The secret corresponding to the per-commitment point */ public void set_per_commitment_secret(byte[] val) { - bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, val); + bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -61,20 +61,25 @@ public class RevokeAndACK extends CommonBase { * The next sender-broadcast commitment transaction's per-commitment point */ public void set_next_per_commitment_point(byte[] val) { - bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, val); + bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** * Constructs a new RevokeAndACK given each field */ public static RevokeAndACK of(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) { - long ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg); + long ret = bindings.RevokeAndACK_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(per_commitment_secret_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33)); if (ret >= 0 && ret <= 4096) { return null; } RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RevokeAndACK(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.RevokeAndACK_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RevokeAndACK */ diff --git a/src/main/java/org/ldk/structs/Route.java b/src/main/java/org/ldk/structs/Route.java index 9a7f6272..453292e8 100644 --- a/src/main/java/org/ldk/structs/Route.java +++ b/src/main/java/org/ldk/structs/Route.java @@ -99,6 +99,11 @@ public class Route extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.Route_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Route */ diff --git a/src/main/java/org/ldk/structs/RouteHint.java b/src/main/java/org/ldk/structs/RouteHint.java index 1b0ddef8..6ead7770 100644 --- a/src/main/java/org/ldk/structs/RouteHint.java +++ b/src/main/java/org/ldk/structs/RouteHint.java @@ -46,6 +46,11 @@ public class RouteHint extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.RouteHint_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RouteHint */ diff --git a/src/main/java/org/ldk/structs/RouteHintHop.java b/src/main/java/org/ldk/structs/RouteHintHop.java index 86018744..47f38b33 100644 --- a/src/main/java/org/ldk/structs/RouteHintHop.java +++ b/src/main/java/org/ldk/structs/RouteHintHop.java @@ -31,7 +31,7 @@ public class RouteHintHop extends CommonBase { * The node_id of the non-target end of the route */ public void set_src_node_id(byte[] val) { - bindings.RouteHintHop_set_src_node_id(this.ptr, val); + bindings.RouteHintHop_set_src_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -122,13 +122,18 @@ public class RouteHintHop extends CommonBase { * Constructs a new RouteHintHop given each field */ public static RouteHintHop of(byte[] src_node_id_arg, long short_channel_id_arg, RoutingFees fees_arg, short cltv_expiry_delta_arg, Option_u64Z htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg) { - long ret = bindings.RouteHintHop_new(src_node_id_arg, short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); + long ret = bindings.RouteHintHop_new(InternalUtils.check_arr_len(src_node_id_arg, 33), short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); if (ret >= 0 && ret <= 4096) { return null; } RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHintHop(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.RouteHintHop_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RouteHintHop */ diff --git a/src/main/java/org/ldk/structs/RouteHop.java b/src/main/java/org/ldk/structs/RouteHop.java index 59d48646..f2168f4b 100644 --- a/src/main/java/org/ldk/structs/RouteHop.java +++ b/src/main/java/org/ldk/structs/RouteHop.java @@ -31,7 +31,7 @@ public class RouteHop extends CommonBase { * The node_id of the node at this hop. */ public void set_pubkey(byte[] val) { - bindings.RouteHop_set_pubkey(this.ptr, val); + bindings.RouteHop_set_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -129,13 +129,18 @@ public class RouteHop extends CommonBase { * Constructs a new RouteHop given each field */ public static RouteHop of(byte[] pubkey_arg, NodeFeatures node_features_arg, long short_channel_id_arg, ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg) { - long ret = bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg); + long ret = bindings.RouteHop_new(InternalUtils.check_arr_len(pubkey_arg, 33), node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg); if (ret >= 0 && ret <= 4096) { return null; } RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHop(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.RouteHop_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RouteHop */ diff --git a/src/main/java/org/ldk/structs/RouteParameters.java b/src/main/java/org/ldk/structs/RouteParameters.java index 731c3a37..66561f73 100644 --- a/src/main/java/org/ldk/structs/RouteParameters.java +++ b/src/main/java/org/ldk/structs/RouteParameters.java @@ -83,6 +83,11 @@ public class RouteParameters extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.RouteParameters_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RouteParameters */ diff --git a/src/main/java/org/ldk/structs/Router.java b/src/main/java/org/ldk/structs/Router.java index 4174246e..b83762e1 100644 --- a/src/main/java/org/ldk/structs/Router.java +++ b/src/main/java/org/ldk/structs/Router.java @@ -47,7 +47,7 @@ public class Router extends CommonBase { Score ret_hu_conv = new Score(null, scorer); ret_hu_conv.ptrs_to.add(this); Result_RouteLightningErrorZ ret = arg.find_route(payer, params_hu_conv, first_hops_conv_16_arr, ret_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }); @@ -59,7 +59,7 @@ public class Router extends CommonBase { * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ public Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters params, @Nullable ChannelDetails[] first_hops, Score scorer) { - long ret = bindings.Router_find_route(this.ptr, payer, params == null ? 0 : params.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, scorer == null ? 0 : scorer.ptr); + long ret = bindings.Router_find_route(this.ptr, InternalUtils.check_arr_len(payer, 33), params == null ? 0 : params.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, scorer == null ? 0 : scorer.ptr); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(params); diff --git a/src/main/java/org/ldk/structs/RoutingFees.java b/src/main/java/org/ldk/structs/RoutingFees.java index 2ad54fe1..dfca382a 100644 --- a/src/main/java/org/ldk/structs/RoutingFees.java +++ b/src/main/java/org/ldk/structs/RoutingFees.java @@ -73,6 +73,11 @@ public class RoutingFees extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.RoutingFees_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RoutingFees */ diff --git a/src/main/java/org/ldk/structs/RoutingMessageHandler.java b/src/main/java/org/ldk/structs/RoutingMessageHandler.java index eb619871..c821ddce 100644 --- a/src/main/java/org/ldk/structs/RoutingMessageHandler.java +++ b/src/main/java/org/ldk/structs/RoutingMessageHandler.java @@ -98,29 +98,29 @@ public class RoutingMessageHandler extends CommonBase { @Override public long handle_node_announcement(long msg) { NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new NodeAnnouncement(null, msg); } Result_boolLightningErrorZ ret = arg.handle_node_announcement(msg_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long handle_channel_announcement(long msg) { ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelAnnouncement(null, msg); } Result_boolLightningErrorZ ret = arg.handle_channel_announcement(msg_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long handle_channel_update(long msg) { ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); } Result_boolLightningErrorZ ret = arg.handle_channel_update(msg_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long[] get_next_channel_announcements(long starting_point, byte batch_amount) { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[] ret = arg.get_next_channel_announcements(starting_point, batch_amount); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_59 -> ret_conv_59 != null ? ret_conv_59.ptr : 0).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_59 -> ret_conv_59 == null ? 0 : ret_conv_59.clone_ptr()).toArray() : null; return result; } @Override public long[] get_next_node_announcements(byte[] starting_point, byte batch_amount) { NodeAnnouncement[] ret = arg.get_next_node_announcements(starting_point, batch_amount); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.ptr & ~1).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.clone_ptr()).toArray() : null; return result; } @Override public void sync_routing_table(byte[] their_node_id, long init) { @@ -131,28 +131,28 @@ public class RoutingMessageHandler extends CommonBase { ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyChannelRange(null, msg); } msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_reply_channel_range(their_node_id, msg_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long handle_reply_short_channel_ids_end(byte[] their_node_id, long msg) { ReplyShortChannelIdsEnd msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyShortChannelIdsEnd(null, msg); } msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_reply_short_channel_ids_end(their_node_id, msg_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long handle_query_channel_range(byte[] their_node_id, long msg) { QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryChannelRange(null, msg); } msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_query_channel_range(their_node_id, msg_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long handle_query_short_channel_ids(byte[] their_node_id, long msg) { QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryShortChannelIds(null, msg); } msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_query_short_channel_ids(their_node_id, msg_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); @@ -230,7 +230,7 @@ public class RoutingMessageHandler extends CommonBase { * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None */ public NodeAnnouncement[] get_next_node_announcements(@Nullable byte[] starting_point, byte batch_amount) { - long[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, starting_point, batch_amount); + long[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, InternalUtils.check_arr_len(starting_point, 33), batch_amount); NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret.length]; for (int s = 0; s < ret.length; s++) { long ret_conv_18 = ret[s]; @@ -247,7 +247,7 @@ public class RoutingMessageHandler extends CommonBase { * implementor. */ public void sync_routing_table(byte[] their_node_id, Init init) { - bindings.RoutingMessageHandler_sync_routing_table(this.ptr, their_node_id, init == null ? 0 : init.ptr & ~1); + bindings.RoutingMessageHandler_sync_routing_table(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr & ~1); this.ptrs_to.add(init); } @@ -257,7 +257,7 @@ public class RoutingMessageHandler extends CommonBase { * replies to a single query. */ public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg) { - long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -270,7 +270,7 @@ public class RoutingMessageHandler extends CommonBase { * gossip messages. */ public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, ReplyShortChannelIdsEnd msg) { - long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -281,7 +281,7 @@ public class RoutingMessageHandler extends CommonBase { * for the requested range of blocks. */ public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, QueryChannelRange msg) { - long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -292,7 +292,7 @@ public class RoutingMessageHandler extends CommonBase { * list of short_channel_ids. */ public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, QueryShortChannelIds msg) { - long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; diff --git a/src/main/java/org/ldk/structs/Sha256.java b/src/main/java/org/ldk/structs/Sha256.java index 47a2cae6..011cd861 100644 --- a/src/main/java/org/ldk/structs/Sha256.java +++ b/src/main/java/org/ldk/structs/Sha256.java @@ -19,6 +19,11 @@ public class Sha256 extends CommonBase { if (ptr != 0) { bindings.Sha256_free(ptr); } } + long clone_ptr() { + long ret = bindings.Sha256_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Sha256 */ diff --git a/src/main/java/org/ldk/structs/Shutdown.java b/src/main/java/org/ldk/structs/Shutdown.java index 4c0e6f48..7238ff97 100644 --- a/src/main/java/org/ldk/structs/Shutdown.java +++ b/src/main/java/org/ldk/structs/Shutdown.java @@ -31,7 +31,7 @@ public class Shutdown extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.Shutdown_set_channel_id(this.ptr, val); + bindings.Shutdown_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -55,13 +55,18 @@ public class Shutdown extends CommonBase { * Constructs a new Shutdown given each field */ public static Shutdown of(byte[] channel_id_arg, byte[] scriptpubkey_arg) { - long ret = bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg); + long ret = bindings.Shutdown_new(InternalUtils.check_arr_len(channel_id_arg, 32), scriptpubkey_arg); if (ret >= 0 && ret <= 4096) { return null; } Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Shutdown(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.Shutdown_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the Shutdown */ diff --git a/src/main/java/org/ldk/structs/ShutdownScript.java b/src/main/java/org/ldk/structs/ShutdownScript.java index 19a81ae0..f60f0c25 100644 --- a/src/main/java/org/ldk/structs/ShutdownScript.java +++ b/src/main/java/org/ldk/structs/ShutdownScript.java @@ -21,6 +21,11 @@ public class ShutdownScript extends CommonBase { if (ptr != 0) { bindings.ShutdownScript_free(ptr); } } + long clone_ptr() { + long ret = bindings.ShutdownScript_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the ShutdownScript */ @@ -54,7 +59,7 @@ public class ShutdownScript extends CommonBase { * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`]. */ public static ShutdownScript new_p2wpkh(byte[] pubkey_hash) { - long ret = bindings.ShutdownScript_new_p2wpkh(pubkey_hash); + long ret = bindings.ShutdownScript_new_p2wpkh(InternalUtils.check_arr_len(pubkey_hash, 20)); if (ret >= 0 && ret <= 4096) { return null; } ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -65,7 +70,7 @@ public class ShutdownScript extends CommonBase { * Generates a P2WSH script pubkey from the given [`WScriptHash`]. */ public static ShutdownScript new_p2wsh(byte[] script_hash) { - long ret = bindings.ShutdownScript_new_p2wsh(script_hash); + long ret = bindings.ShutdownScript_new_p2wsh(InternalUtils.check_arr_len(script_hash, 32)); if (ret >= 0 && ret <= 4096) { return null; } ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/Sign.java b/src/main/java/org/ldk/structs/Sign.java index 5a022158..57277357 100644 --- a/src/main/java/org/ldk/structs/Sign.java +++ b/src/main/java/org/ldk/structs/Sign.java @@ -18,7 +18,7 @@ public class Sign extends CommonBase { final bindings.LDKSign bindings_instance; Sign(Object _dummy, long ptr) { super(ptr); bindings_instance = null; } private Sign(bindings.LDKSign arg, bindings.LDKBaseSign BaseSign, ChannelPublicKeys pubkeys) { - super(bindings.LDKSign_new(arg, BaseSign, pubkeys == null ? 0 : pubkeys.ptr & ~1)); + super(bindings.LDKSign_new(arg, BaseSign, pubkeys == null ? 0 : pubkeys.clone_ptr())); this.ptrs_to.add(arg); this.ptrs_to.add(BaseSign); this.bindings_instance = arg; @@ -63,6 +63,11 @@ public class Sign extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.Sign_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of a Sign */ diff --git a/src/main/java/org/ldk/structs/SignOrCreationError.java b/src/main/java/org/ldk/structs/SignOrCreationError.java index 8273e9b1..8bc1550f 100644 --- a/src/main/java/org/ldk/structs/SignOrCreationError.java +++ b/src/main/java/org/ldk/structs/SignOrCreationError.java @@ -30,11 +30,17 @@ public class SignOrCreationError extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * An error occurred during signing + */ public final static class SignError extends SignOrCreationError { private SignError(long ptr, bindings.LDKSignOrCreationError.SignError obj) { super(null, ptr); } } + /** + * An error occurred while building the transaction + */ public final static class CreationError extends SignOrCreationError { public final org.ldk.enums.CreationError creation_error; private CreationError(long ptr, bindings.LDKSignOrCreationError.CreationError obj) { @@ -42,6 +48,11 @@ public class SignOrCreationError extends CommonBase { this.creation_error = obj.creation_error; } } + long clone_ptr() { + long ret = bindings.SignOrCreationError_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the SignOrCreationError */ diff --git a/src/main/java/org/ldk/structs/SignedRawInvoice.java b/src/main/java/org/ldk/structs/SignedRawInvoice.java index 0b976307..f9fd6c3d 100644 --- a/src/main/java/org/ldk/structs/SignedRawInvoice.java +++ b/src/main/java/org/ldk/structs/SignedRawInvoice.java @@ -34,6 +34,11 @@ public class SignedRawInvoice extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.SignedRawInvoice_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the SignedRawInvoice */ diff --git a/src/main/java/org/ldk/structs/SocketDescriptor.java b/src/main/java/org/ldk/structs/SocketDescriptor.java index ae23786d..3edbde56 100644 --- a/src/main/java/org/ldk/structs/SocketDescriptor.java +++ b/src/main/java/org/ldk/structs/SocketDescriptor.java @@ -139,6 +139,11 @@ public class SocketDescriptor extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.SocketDescriptor_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of a SocketDescriptor */ diff --git a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java index 236a33fe..34ff18ac 100644 --- a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java @@ -36,6 +36,13 @@ public class SpendableOutputDescriptor extends CommonBase { assert false; return null; // Unreachable without extending the (internal) bindings interface } + /** + * An output to a script which was provided via KeysInterface directly, either from + * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know + * how to spend it. No secret keys are provided as rust-lightning was never given any key. + * These may include outputs from a transaction punishing our counterparty or claiming an HTLC + * on-chain using the payment preimage or after it has timed out. + */ public final static class StaticOutput extends SpendableOutputDescriptor { /** * The outpoint which is spendable @@ -56,6 +63,36 @@ public class SpendableOutputDescriptor extends CommonBase { this.output = output_conv; } } + /** + * An output to a P2WSH script which can be spent with a single signature after a CSV delay. + * + * The witness in the spending input should be: + * (MINIMALIF standard rule) + * + * Note that the nSequence field in the spending input must be set to to_self_delay + * (which means the transaction is not broadcastable until at least to_self_delay + * blocks after the outpoint confirms). + * + * These are generally the result of a \"revocable\" output to us, spendable only by us unless + * it is an output from an old state which we broadcast (which should never happen). + * + * To derive the delayed_payment key which is used to sign for this input, you must pass the + * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in + * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to + * chan_utils::derive_private_key. The public key can be generated without the secret key + * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in + * Sign::pubkeys(). + * + * To derive the revocation_pubkey provided here (which is used in the witness + * script generation), you must pass the counterparty revocation_basepoint (which appears in the + * call to Sign::ready_channel) and the provided per_commitment point + * to chan_utils::derive_public_revocation_key. + * + * The witness script which is hashed and included in the output script_pubkey may be + * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey + * (derived as above), and the to_self_delay contained here to + * chan_utils::get_revokeable_redeemscript. + */ public final static class DelayedPaymentOutput extends SpendableOutputDescriptor { public final DelayedPaymentOutputDescriptor delayed_payment_output; private DelayedPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput obj) { @@ -66,6 +103,15 @@ public class SpendableOutputDescriptor extends CommonBase { this.delayed_payment_output = delayed_payment_output_hu_conv; } } + /** + * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which + * corresponds to the public key in Sign::pubkeys().payment_point). + * The witness in the spending input, is, thus, simply: + * + * + * These are generally the result of our counterparty having broadcast the current state, + * allowing us to claim the non-HTLC-encumbered outputs immediately. + */ public final static class StaticPaymentOutput extends SpendableOutputDescriptor { public final StaticPaymentOutputDescriptor static_payment_output; private StaticPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput obj) { @@ -76,6 +122,11 @@ public class SpendableOutputDescriptor extends CommonBase { this.static_payment_output = static_payment_output_hu_conv; } } + long clone_ptr() { + long ret = bindings.SpendableOutputDescriptor_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the SpendableOutputDescriptor */ diff --git a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java index f3b4d7d4..7fcb906e 100644 --- a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java @@ -61,7 +61,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase { * the channel to spend the output. */ public void set_channel_keys_id(byte[] val) { - bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val); + bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -83,13 +83,18 @@ public class StaticPaymentOutputDescriptor extends CommonBase { * Constructs a new StaticPaymentOutputDescriptor given each field */ public static StaticPaymentOutputDescriptor of(OutPoint outpoint_arg, TxOut output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { - long ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, output_arg.ptr, channel_keys_id_arg, channel_value_satoshis_arg); + long ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, output_arg.ptr, InternalUtils.check_arr_len(channel_keys_id_arg, 32), channel_value_satoshis_arg); if (ret >= 0 && ret <= 4096) { return null; } StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.StaticPaymentOutputDescriptor_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the StaticPaymentOutputDescriptor */ diff --git a/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java b/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java index 01538856..ffc06129 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java @@ -19,4 +19,65 @@ public class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C if (ptr != 0) { bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(ptr); } } + /** + * + */ + public ChannelAnnouncement get_a() { + long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * + */ + public ChannelUpdate get_b() { + long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * + */ + public ChannelUpdate get_c() { + long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ clone() { + long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements. + */ + public static ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ of(ChannelAnnouncement a, ChannelUpdate b, ChannelUpdate c) { + long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a == null ? 0 : a.ptr & ~1, b == null ? 0 : b.ptr & ~1, c == null ? 0 : c.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java b/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java index b0b3a914..41931460 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java @@ -19,4 +19,62 @@ public class ThreeTuple_RawInvoice_u832InvoiceSignatureZ extends CommonBase { if (ptr != 0) { bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(ptr); } } + /** + * + */ + public RawInvoice get_a() { + long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * + */ + public byte[] get_b() { + byte[] ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(this.ptr); + return ret; + } + + /** + * + */ + public InvoiceSignature get_c() { + long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(this.ptr); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public ThreeTuple_RawInvoice_u832InvoiceSignatureZ clone() { + long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(this.ptr); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements. + */ + public static ThreeTuple_RawInvoice_u832InvoiceSignatureZ of(RawInvoice a, byte[] b, InvoiceSignature c) { + long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a == null ? 0 : a.ptr & ~1, InternalUtils.check_arr_len(b, 32), c == null ? 0 : c.ptr & ~1); + if (ret >= 0 && ret <= 4096) { return null; } + ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/TrustedClosingTransaction.java b/src/main/java/org/ldk/structs/TrustedClosingTransaction.java index 027f9cd6..65fca265 100644 --- a/src/main/java/org/ldk/structs/TrustedClosingTransaction.java +++ b/src/main/java/org/ldk/structs/TrustedClosingTransaction.java @@ -47,7 +47,7 @@ public class TrustedClosingTransaction extends CommonBase { * because we are about to broadcast a holder transaction. */ public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { - byte[] ret = bindings.TrustedClosingTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis); + byte[] ret = bindings.TrustedClosingTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis); return ret; } diff --git a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java index 0816d27c..b282b7a9 100644 --- a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java @@ -61,7 +61,7 @@ public class TrustedCommitmentTransaction extends CommonBase { * The returned Vec has one entry for each HTLC, and in the same order. */ public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters) { - long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, htlc_base_key, channel_parameters == null ? 0 : channel_parameters.ptr & ~1); + long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); this.ptrs_to.add(channel_parameters); diff --git a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java index 949ac9c2..8a560051 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java @@ -42,7 +42,7 @@ public class TwoTuple_BlockHashChannelManagerZ extends CommonBase { * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements. */ public static TwoTuple_BlockHashChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Logger b_logger, KeysInterface b_keys_manager, UserConfig b_config, ChainParameters b_params) { - long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(a, bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_logger == null ? 0 : b_logger.ptr, b_keys_manager == null ? 0 : b_keys_manager.ptr, b_config == null ? 0 : b_config.ptr & ~1, b_params == null ? 0 : b_params.ptr & ~1)); + long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_logger == null ? 0 : b_logger.ptr, b_keys_manager == null ? 0 : b_keys_manager.ptr, b_config == null ? 0 : b_config.ptr & ~1, b_params == null ? 0 : b_params.ptr & ~1)); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_BlockHashChannelManagerZ ret_hu_conv = new TwoTuple_BlockHashChannelManagerZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java index 5f153087..4cedf1ff 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java @@ -38,6 +38,11 @@ public class TwoTuple_BlockHashChannelMonitorZ extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. @@ -54,7 +59,7 @@ public class TwoTuple_BlockHashChannelMonitorZ extends CommonBase { * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements. */ public static TwoTuple_BlockHashChannelMonitorZ of(byte[] a, ChannelMonitor b) { - long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_new(a, b == null ? 0 : b.ptr & ~1); + long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_new(InternalUtils.check_arr_len(a, 32), b == null ? 0 : b.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_BlockHashChannelMonitorZ ret_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java index d0582880..2cb31e27 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java @@ -38,6 +38,11 @@ public class TwoTuple_OutPointScriptZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.C2Tuple_OutPointScriptZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentIdZ.java b/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentIdZ.java index 2f1caded..2f8a8dd8 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentIdZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentIdZ.java @@ -35,6 +35,11 @@ public class TwoTuple_PaymentHashPaymentIdZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. @@ -51,7 +56,7 @@ public class TwoTuple_PaymentHashPaymentIdZ extends CommonBase { * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements. */ public static TwoTuple_PaymentHashPaymentIdZ of(byte[] a, byte[] b) { - long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(a, b); + long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32)); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentSecretZ.java b/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentSecretZ.java index 0ba6ac80..f443be0e 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentSecretZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentSecretZ.java @@ -35,6 +35,11 @@ public class TwoTuple_PaymentHashPaymentSecretZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. @@ -51,7 +56,7 @@ public class TwoTuple_PaymentHashPaymentSecretZ extends CommonBase { * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements. */ public static TwoTuple_PaymentHashPaymentSecretZ of(byte[] a, byte[] b) { - long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(a, b); + long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32)); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java b/src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java index 90a42ae8..780d94ff 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java @@ -38,6 +38,11 @@ public class TwoTuple_PublicKeyTypeZ extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.C2Tuple_PublicKeyTypeZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. @@ -54,7 +59,7 @@ public class TwoTuple_PublicKeyTypeZ extends CommonBase { * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements. */ public static TwoTuple_PublicKeyTypeZ of(byte[] a, Type b) { - long ret = bindings.C2Tuple_PublicKeyTypeZ_new(a, b == null ? 0 : b.ptr); + long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b == null ? 0 : b.ptr); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_PublicKeyTypeZ ret_hu_conv = new TwoTuple_PublicKeyTypeZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/TwoTuple_SignatureCVec_SignatureZZ.java b/src/main/java/org/ldk/structs/TwoTuple_SignatureCVec_SignatureZZ.java index 3118746c..1178bd66 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_SignatureCVec_SignatureZZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_SignatureCVec_SignatureZZ.java @@ -35,6 +35,11 @@ public class TwoTuple_SignatureCVec_SignatureZZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. @@ -51,7 +56,7 @@ public class TwoTuple_SignatureCVec_SignatureZZ extends CommonBase { * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements. */ public static TwoTuple_SignatureCVec_SignatureZZ of(byte[] a, byte[][] b) { - long ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_new(a, b); + long ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_new(InternalUtils.check_arr_len(a, 64), b != null ? Arrays.stream(b).map(b_conv_8 -> InternalUtils.check_arr_len(b_conv_8, 64)).toArray(byte[][]::new) : null); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_SignatureCVec_SignatureZZ ret_hu_conv = new TwoTuple_SignatureCVec_SignatureZZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.java b/src/main/java/org/ldk/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.java index 6ea8960e..49fd339b 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.java @@ -42,6 +42,11 @@ public class TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ extends CommonBase { return ret_conv_21_arr; } + long clone_ptr() { + long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. @@ -58,7 +63,7 @@ public class TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ extends CommonBase { * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements. */ public static TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ of(byte[] a, TwoTuple_u32ScriptZ[] b) { - long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a, b != null ? Arrays.stream(b).mapToLong(b_conv_21 -> b_conv_21 != null ? b_conv_21.ptr : 0).toArray() : null); + long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(InternalUtils.check_arr_len(a, 32), b != null ? Arrays.stream(b).mapToLong(b_conv_21 -> b_conv_21 != null ? b_conv_21.ptr : 0).toArray() : null); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.java b/src/main/java/org/ldk/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.java index 926a55b1..b3a0b200 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.java @@ -42,6 +42,11 @@ public class TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ extends CommonBase { return ret_conv_20_arr; } + long clone_ptr() { + long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. @@ -58,7 +63,7 @@ public class TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ extends CommonBase { * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements. */ public static TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ of(byte[] a, TwoTuple_u32TxOutZ[] b) { - long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a, b != null ? Arrays.stream(b).mapToLong(b_conv_20 -> b_conv_20 != null ? b_conv_20.ptr : 0).toArray() : null); + long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(InternalUtils.check_arr_len(a, 32), b != null ? Arrays.stream(b).mapToLong(b_conv_20 -> b_conv_20 != null ? b_conv_20.ptr : 0).toArray() : null); if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); diff --git a/src/main/java/org/ldk/structs/TwoTuple_u32ScriptZ.java b/src/main/java/org/ldk/structs/TwoTuple_u32ScriptZ.java index d7c86936..0579bcec 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_u32ScriptZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_u32ScriptZ.java @@ -35,6 +35,11 @@ public class TwoTuple_u32ScriptZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.C2Tuple_u32ScriptZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/TwoTuple_u32TxOutZ.java b/src/main/java/org/ldk/structs/TwoTuple_u32TxOutZ.java index fba6cad2..5928f428 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_u32TxOutZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_u32TxOutZ.java @@ -37,6 +37,11 @@ public class TwoTuple_u32TxOutZ extends CommonBase { return ret_conv; } + long clone_ptr() { + long ret = bindings.C2Tuple_u32TxOutZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/TwoTuple_usizeTransactionZ.java b/src/main/java/org/ldk/structs/TwoTuple_usizeTransactionZ.java index 73d02f05..459dfea1 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_usizeTransactionZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_usizeTransactionZ.java @@ -35,6 +35,11 @@ public class TwoTuple_usizeTransactionZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.C2Tuple_usizeTransactionZ_clone_ptr(this.ptr); + return ret; + } + /** * Creates a new tuple which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. diff --git a/src/main/java/org/ldk/structs/TxCreationKeys.java b/src/main/java/org/ldk/structs/TxCreationKeys.java index 22e03cf4..f976a6af 100644 --- a/src/main/java/org/ldk/structs/TxCreationKeys.java +++ b/src/main/java/org/ldk/structs/TxCreationKeys.java @@ -41,7 +41,7 @@ public class TxCreationKeys extends CommonBase { * The broadcaster's per-commitment public key which was used to derive the other keys. */ public void set_per_commitment_point(byte[] val) { - bindings.TxCreationKeys_set_per_commitment_point(this.ptr, val); + bindings.TxCreationKeys_set_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -60,7 +60,7 @@ public class TxCreationKeys extends CommonBase { * an old state. */ public void set_revocation_key(byte[] val) { - bindings.TxCreationKeys_set_revocation_key(this.ptr, val); + bindings.TxCreationKeys_set_revocation_key(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -75,7 +75,7 @@ public class TxCreationKeys extends CommonBase { * Broadcaster's HTLC Key */ public void set_broadcaster_htlc_key(byte[] val) { - bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val); + bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -90,7 +90,7 @@ public class TxCreationKeys extends CommonBase { * Countersignatory's HTLC Key */ public void set_countersignatory_htlc_key(byte[] val) { - bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val); + bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -105,20 +105,25 @@ public class TxCreationKeys extends CommonBase { * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) */ public void set_broadcaster_delayed_payment_key(byte[] val) { - bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val); + bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** * Constructs a new TxCreationKeys given each field */ public static TxCreationKeys of(byte[] per_commitment_point_arg, byte[] revocation_key_arg, byte[] broadcaster_htlc_key_arg, byte[] countersignatory_htlc_key_arg, byte[] broadcaster_delayed_payment_key_arg) { - long ret = bindings.TxCreationKeys_new(per_commitment_point_arg, revocation_key_arg, broadcaster_htlc_key_arg, countersignatory_htlc_key_arg, broadcaster_delayed_payment_key_arg); + long ret = bindings.TxCreationKeys_new(InternalUtils.check_arr_len(per_commitment_point_arg, 33), InternalUtils.check_arr_len(revocation_key_arg, 33), InternalUtils.check_arr_len(broadcaster_htlc_key_arg, 33), InternalUtils.check_arr_len(countersignatory_htlc_key_arg, 33), InternalUtils.check_arr_len(broadcaster_delayed_payment_key_arg, 33)); if (ret >= 0 && ret <= 4096) { return null; } TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TxCreationKeys(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.TxCreationKeys_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the TxCreationKeys */ @@ -153,7 +158,7 @@ public class TxCreationKeys extends CommonBase { * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ public static Result_TxCreationKeysErrorZ derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base) { - long ret = bindings.TxCreationKeys_derive_new(per_commitment_point, broadcaster_delayed_payment_base, broadcaster_htlc_base, countersignatory_revocation_base, countersignatory_htlc_base); + long ret = bindings.TxCreationKeys_derive_new(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(broadcaster_delayed_payment_base, 33), InternalUtils.check_arr_len(broadcaster_htlc_base, 33), InternalUtils.check_arr_len(countersignatory_revocation_base, 33), InternalUtils.check_arr_len(countersignatory_htlc_base, 33)); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -164,7 +169,7 @@ public class TxCreationKeys extends CommonBase { * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ public static Result_TxCreationKeysErrorZ from_channel_static_keys(byte[] per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { - long ret = bindings.TxCreationKeys_from_channel_static_keys(per_commitment_point, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1); + long ret = bindings.TxCreationKeys_from_channel_static_keys(InternalUtils.check_arr_len(per_commitment_point, 33), broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(broadcaster_keys); diff --git a/src/main/java/org/ldk/structs/Type.java b/src/main/java/org/ldk/structs/Type.java index 1bfb88d1..f466a1c1 100644 --- a/src/main/java/org/ldk/structs/Type.java +++ b/src/main/java/org/ldk/structs/Type.java @@ -82,6 +82,11 @@ public class Type extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.Type_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of a Type */ diff --git a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java index 4d0b7c75..0eab38d2 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java @@ -49,7 +49,7 @@ public class UnsignedChannelAnnouncement extends CommonBase { * The genesis hash of the blockchain where the channel is to be opened */ public void set_chain_hash(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -79,7 +79,7 @@ public class UnsignedChannelAnnouncement extends CommonBase { * One of the two node_ids which are endpoints of this channel */ public void set_node_id_1(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -94,7 +94,7 @@ public class UnsignedChannelAnnouncement extends CommonBase { * The other of the two node_ids which are endpoints of this channel */ public void set_node_id_2(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -109,7 +109,7 @@ public class UnsignedChannelAnnouncement extends CommonBase { * The funding key for the first node */ public void set_bitcoin_key_1(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -124,7 +124,12 @@ public class UnsignedChannelAnnouncement extends CommonBase { * The funding key for the second node */ public void set_bitcoin_key_2(byte[] val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, InternalUtils.check_arr_len(val, 33)); + } + + long clone_ptr() { + long ret = bindings.UnsignedChannelAnnouncement_clone_ptr(this.ptr); + return ret; } /** diff --git a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java index 91a5557d..57791437 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java @@ -31,7 +31,7 @@ public class UnsignedChannelUpdate extends CommonBase { * The genesis hash of the blockchain where the channel is to be opened */ public void set_chain_hash(byte[] val) { - bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, val); + bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -153,6 +153,11 @@ public class UnsignedChannelUpdate extends CommonBase { bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val); } + long clone_ptr() { + long ret = bindings.UnsignedChannelUpdate_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UnsignedChannelUpdate */ diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index 57021d8f..f558312e 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -66,7 +66,7 @@ public class UnsignedNodeAnnouncement extends CommonBase { * to this node). */ public void set_node_id(byte[] val) { - bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val); + bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); } /** @@ -81,7 +81,7 @@ public class UnsignedNodeAnnouncement extends CommonBase { * An RGB color for UI purposes */ public void set_rgb(byte[] val) { - bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val); + bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3)); } /** @@ -98,7 +98,7 @@ public class UnsignedNodeAnnouncement extends CommonBase { * of uniqueness. */ public void set_alias(byte[] val) { - bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val); + bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -108,6 +108,11 @@ public class UnsignedNodeAnnouncement extends CommonBase { bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null); } + long clone_ptr() { + long ret = bindings.UnsignedNodeAnnouncement_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UnsignedNodeAnnouncement */ diff --git a/src/main/java/org/ldk/structs/UpdateAddHTLC.java b/src/main/java/org/ldk/structs/UpdateAddHTLC.java index 589d5548..5e9e25a2 100644 --- a/src/main/java/org/ldk/structs/UpdateAddHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateAddHTLC.java @@ -31,7 +31,7 @@ public class UpdateAddHTLC extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.UpdateAddHTLC_set_channel_id(this.ptr, val); + bindings.UpdateAddHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -76,7 +76,7 @@ public class UpdateAddHTLC extends CommonBase { * The payment hash, the pre-image of which controls HTLC redemption */ public void set_payment_hash(byte[] val) { - bindings.UpdateAddHTLC_set_payment_hash(this.ptr, val); + bindings.UpdateAddHTLC_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -94,6 +94,11 @@ public class UpdateAddHTLC extends CommonBase { bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val); } + long clone_ptr() { + long ret = bindings.UpdateAddHTLC_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UpdateAddHTLC */ diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index 3bcb2b0a..4878f340 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -31,7 +31,7 @@ public class UpdateFailHTLC extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.UpdateFailHTLC_set_channel_id(this.ptr, val); + bindings.UpdateFailHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -49,6 +49,11 @@ public class UpdateFailHTLC extends CommonBase { bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val); } + long clone_ptr() { + long ret = bindings.UpdateFailHTLC_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UpdateFailHTLC */ diff --git a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java index 68e48eff..29c7eb56 100644 --- a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java @@ -31,7 +31,7 @@ public class UpdateFailMalformedHTLC extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val); + bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -64,6 +64,11 @@ public class UpdateFailMalformedHTLC extends CommonBase { bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val); } + long clone_ptr() { + long ret = bindings.UpdateFailMalformedHTLC_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UpdateFailMalformedHTLC */ diff --git a/src/main/java/org/ldk/structs/UpdateFee.java b/src/main/java/org/ldk/structs/UpdateFee.java index d5f5a6e6..2df919fe 100644 --- a/src/main/java/org/ldk/structs/UpdateFee.java +++ b/src/main/java/org/ldk/structs/UpdateFee.java @@ -31,7 +31,7 @@ public class UpdateFee extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.UpdateFee_set_channel_id(this.ptr, val); + bindings.UpdateFee_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -53,13 +53,18 @@ public class UpdateFee extends CommonBase { * Constructs a new UpdateFee given each field */ public static UpdateFee of(byte[] channel_id_arg, int feerate_per_kw_arg) { - long ret = bindings.UpdateFee_new(channel_id_arg, feerate_per_kw_arg); + long ret = bindings.UpdateFee_new(InternalUtils.check_arr_len(channel_id_arg, 32), feerate_per_kw_arg); if (ret >= 0 && ret <= 4096) { return null; } UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.UpdateFee_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UpdateFee */ diff --git a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java index 0b34f898..16fd61a6 100644 --- a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java @@ -31,7 +31,7 @@ public class UpdateFulfillHTLC extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, val); + bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -61,20 +61,25 @@ public class UpdateFulfillHTLC extends CommonBase { * The pre-image of the payment hash, allowing HTLC redemption */ public void set_payment_preimage(byte[] val) { - bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, val); + bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** * Constructs a new UpdateFulfillHTLC given each field */ public static UpdateFulfillHTLC of(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) { - long ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg); + long ret = bindings.UpdateFulfillHTLC_new(InternalUtils.check_arr_len(channel_id_arg, 32), htlc_id_arg, InternalUtils.check_arr_len(payment_preimage_arg, 32)); if (ret >= 0 && ret <= 4096) { return null; } UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFulfillHTLC(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.UpdateFulfillHTLC_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UpdateFulfillHTLC */ diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index 2037a9f1..055f38fe 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -132,6 +132,11 @@ public class UserConfig extends CommonBase { return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.UserConfig_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UserConfig */ diff --git a/src/main/java/org/ldk/structs/UtilMethods.java b/src/main/java/org/ldk/structs/UtilMethods.java index dac1f32c..f3bc9b17 100644 --- a/src/main/java/org/ldk/structs/UtilMethods.java +++ b/src/main/java/org/ldk/structs/UtilMethods.java @@ -1,17 +1,38 @@ package org.ldk.structs; import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; import java.util.Arrays; import javax.annotation.Nullable; -import org.ldk.enums.*; public class UtilMethods { + /** + * Read a ClosureReason from a byte array, created by ClosureReason_write + */ + public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) { + long ret = bindings.ClosureReason_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a Event from a byte array, created by Event_write + */ + public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) { + long ret = bindings.Event_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Creates a digital signature of a message given a SecretKey, like the node's secret. * A receiver knowing the PublicKey (e.g. the node's id) and the message can be sure that the signature was generated by the caller. * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted. */ public static Result_StringErrorZ sign(byte[] msg, byte[] sk) { - long ret = bindings.sign(msg, sk); + long ret = bindings.sign(msg, InternalUtils.check_arr_len(sk, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -32,10 +53,20 @@ public class UtilMethods { * and the PublicKey. */ public static boolean verify(byte[] msg, java.lang.String sig, byte[] pk) { - boolean ret = bindings.verify(msg, sig, pk); + boolean ret = bindings.verify(msg, sig, InternalUtils.check_arr_len(pk, 33)); return ret; } + /** + * Read a MonitorEvent from a byte array, created by MonitorEvent_write + */ + public static Result_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(byte[] ser) { + long ret = bindings.MonitorEvent_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write */ @@ -68,7 +99,7 @@ public class UtilMethods { * Build the commitment secret from the seed and the commitment number */ public static byte[] build_commitment_secret(byte[] commitment_seed, long idx) { - byte[] ret = bindings.build_commitment_secret(commitment_seed, idx); + byte[] ret = bindings.build_commitment_secret(InternalUtils.check_arr_len(commitment_seed, 32), idx); return ret; } @@ -88,7 +119,7 @@ public class UtilMethods { * generated (ie our own). */ public static Result_SecretKeyErrorZ derive_private_key(byte[] per_commitment_point, byte[] base_secret) { - long ret = bindings.derive_private_key(per_commitment_point, base_secret); + long ret = bindings.derive_private_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_secret, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -103,7 +134,7 @@ public class UtilMethods { * generated (ie our own). */ public static Result_PublicKeyErrorZ derive_public_key(byte[] per_commitment_point, byte[] base_point) { - long ret = bindings.derive_public_key(per_commitment_point, base_point); + long ret = bindings.derive_public_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_point, 33)); if (ret >= 0 && ret <= 4096) { return null; } Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -121,7 +152,7 @@ public class UtilMethods { * generated (ie our own). */ public static Result_SecretKeyErrorZ derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret) { - long ret = bindings.derive_private_revocation_key(per_commitment_secret, countersignatory_revocation_base_secret); + long ret = bindings.derive_private_revocation_key(InternalUtils.check_arr_len(per_commitment_secret, 32), InternalUtils.check_arr_len(countersignatory_revocation_base_secret, 32)); if (ret >= 0 && ret <= 4096) { return null; } Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -141,7 +172,7 @@ public class UtilMethods { * generated (ie our own). */ public static Result_PublicKeyErrorZ derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point) { - long ret = bindings.derive_public_revocation_key(per_commitment_point, countersignatory_revocation_base_point); + long ret = bindings.derive_public_revocation_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(countersignatory_revocation_base_point, 33)); if (ret >= 0 && ret <= 4096) { return null; } Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -153,7 +184,7 @@ public class UtilMethods { * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions. */ public static byte[] get_revokeable_redeemscript(byte[] revocation_key, short contest_delay, byte[] broadcaster_delayed_payment_key) { - byte[] ret = bindings.get_revokeable_redeemscript(revocation_key, contest_delay, broadcaster_delayed_payment_key); + byte[] ret = bindings.get_revokeable_redeemscript(InternalUtils.check_arr_len(revocation_key, 33), contest_delay, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33)); return ret; } @@ -173,7 +204,7 @@ public class UtilMethods { * Note that the order of funding public keys does not matter. */ public static byte[] make_funding_redeemscript(byte[] broadcaster, byte[] countersignatory) { - byte[] ret = bindings.make_funding_redeemscript(broadcaster, countersignatory); + byte[] ret = bindings.make_funding_redeemscript(InternalUtils.check_arr_len(broadcaster, 33), InternalUtils.check_arr_len(countersignatory, 33)); return ret; } @@ -187,7 +218,7 @@ public class UtilMethods { * commitment transaction). */ public static byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, HTLCOutputInCommitment htlc, byte[] broadcaster_delayed_payment_key, byte[] revocation_key) { - byte[] ret = bindings.build_htlc_transaction(commitment_txid, feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, broadcaster_delayed_payment_key, revocation_key); + byte[] ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33)); // this.ptrs_to.add(htlc); return ret; } @@ -201,10 +232,20 @@ public class UtilMethods { * \"decrypt\" the commitment transaction number given a commitment transaction on-chain. */ public static long get_commitment_transaction_number_obscure_factor(byte[] broadcaster_payment_basepoint, byte[] countersignatory_payment_basepoint, boolean outbound_from_broadcaster) { - long ret = bindings.get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint, countersignatory_payment_basepoint, outbound_from_broadcaster); + long ret = bindings.get_commitment_transaction_number_obscure_factor(InternalUtils.check_arr_len(broadcaster_payment_basepoint, 33), InternalUtils.check_arr_len(countersignatory_payment_basepoint, 33), outbound_from_broadcaster); return ret; } + /** + * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write + */ + public static Result_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(byte[] ser) { + long ret = bindings.NetworkUpdate_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Finds a route from us (payer) to the given target node (payee). * @@ -238,7 +279,7 @@ public class UtilMethods { * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, RouteParameters params, NetworkGraph network, @Nullable ChannelDetails[] first_hops, Logger logger, Score scorer) { - long ret = bindings.find_route(our_node_pubkey, params == null ? 0 : params.ptr & ~1, network == null ? 0 : network.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr); + long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), params == null ? 0 : params.ptr & ~1, network == null ? 0 : network.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(params); diff --git a/src/main/java/org/ldk/structs/Watch.java b/src/main/java/org/ldk/structs/Watch.java index be66801b..a8bc48e8 100644 --- a/src/main/java/org/ldk/structs/Watch.java +++ b/src/main/java/org/ldk/structs/Watch.java @@ -89,7 +89,7 @@ public class Watch extends CommonBase { ChannelMonitor monitor_hu_conv = null; if (monitor < 0 || monitor > 4096) { monitor_hu_conv = new ChannelMonitor(null, monitor); } monitor_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.watch_channel(funding_txo_hu_conv, monitor_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long update_channel(long funding_txo, long update) { @@ -98,12 +98,12 @@ public class Watch extends CommonBase { ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new ChannelMonitorUpdate(null, update); } update_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.update_channel(funding_txo_hu_conv, update_hu_conv); - long result = ret != null ? ret.ptr : 0; + long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long[] release_pending_monitor_events() { MonitorEvent[] ret = arg.release_pending_monitor_events(); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_14 -> ret_conv_14.ptr).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_14 -> ret_conv_14 == null ? 0 : ret_conv_14.clone_ptr()).toArray() : null; return result; } }); diff --git a/src/main/java/org/ldk/structs/WatchedOutput.java b/src/main/java/org/ldk/structs/WatchedOutput.java index 2014286b..c0e7403d 100644 --- a/src/main/java/org/ldk/structs/WatchedOutput.java +++ b/src/main/java/org/ldk/structs/WatchedOutput.java @@ -46,7 +46,7 @@ public class WatchedOutput extends CommonBase { * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ public void set_block_hash(@Nullable byte[] val) { - bindings.WatchedOutput_set_block_hash(this.ptr, val); + bindings.WatchedOutput_set_block_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -86,13 +86,18 @@ public class WatchedOutput extends CommonBase { * Constructs a new WatchedOutput given each field */ public static WatchedOutput of(byte[] block_hash_arg, OutPoint outpoint_arg, byte[] script_pubkey_arg) { - long ret = bindings.WatchedOutput_new(block_hash_arg, outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg); + long ret = bindings.WatchedOutput_new(InternalUtils.check_arr_len(block_hash_arg, 32), outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg); if (ret >= 0 && ret <= 4096) { return null; } WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WatchedOutput(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.WatchedOutput_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the WatchedOutput */ diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 32c63298..704f9f31 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -13,6 +13,7 @@ #define MALLOC(a, _) malloc(a) #define FREE(p) if ((uint64_t)(p) > 4096) { free(p); } #define CHECK_ACCESS(p) +#define CHECK_INNER_FIELD_ACCESS_OR_NULL(v) #define DO_ASSERT(a) (void)(a) #define CHECK(a) @@ -723,21 +724,6 @@ static inline jclass LDKSiPrefix_to_java(JNIEnv *env, LDKSiPrefix val) { } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1new(JNIEnv *env, jclass clz, int8_tArray elems) { - LDKCVec_u8Z *ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVec_u8Z Data"); - int8_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen); @@ -758,9 +744,6 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}JNIEXPO return ret_val; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SecretKeyErrorZ *val = (LDKCResult_SecretKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -774,9 +757,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_ jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PublicKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PublicKeyErrorZ *val = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -790,9 +770,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_ jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxCreationKeysDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -800,6 +777,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -810,12 +788,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelPublicKeysDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -823,6 +799,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -833,12 +810,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxCreationKeysErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -846,6 +821,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -883,9 +859,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -893,6 +866,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCom uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -903,12 +877,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCom uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -916,6 +888,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyCha uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -926,12 +899,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyCha uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -939,6 +910,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransact uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -949,12 +921,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransact uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -962,6 +932,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -972,12 +943,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -985,6 +954,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitment uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -995,12 +965,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitment uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TrustedClosingTransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1008,6 +976,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingT uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1016,9 +985,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTran CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1026,6 +992,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTrans uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1036,12 +1003,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTrans uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TrustedCommitmentTransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1049,6 +1014,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitme uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1057,9 +1023,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentT CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok; -} JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1080,9 +1043,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNo CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownScriptDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1090,6 +1050,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1100,12 +1061,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); CHECK(val->result_ok); @@ -1113,6 +1072,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptI uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1123,12 +1083,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptI uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneErrorZ *val = (LDKCResult_NoneErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1140,9 +1098,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_ jclass err_conv = LDKIOError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHopDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1150,6 +1105,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1160,29 +1116,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVec_RouteHopZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKRouteHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1197,9 +1134,6 @@ static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_C } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1207,6 +1141,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1217,12 +1152,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1230,6 +1163,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParameters uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1240,29 +1174,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParameters uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKRouteHint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1298,9 +1213,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1308,6 +1220,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1318,29 +1231,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKRouteHintHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHintHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1348,9 +1242,6 @@ static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_Route } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1358,6 +1249,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1368,12 +1260,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1381,6 +1271,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1391,29 +1282,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKChannelDetails arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelDetails_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1421,9 +1293,6 @@ static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_C } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1431,6 +1300,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1441,12 +1311,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1480,26 +1348,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransacti return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_usizeTransactionZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "LDKCVec_C2Tuple_usizeTransactionZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * ret->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1514,9 +1362,6 @@ static inline LDKCVec_TxidZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_TxidZ *orig } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); CHECK(val->result_ok); @@ -1566,6 +1411,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t htlc_event_ref = 0; CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref); } @@ -1574,6 +1420,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t commitment_tx_confirmed_ref = 0; CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref); } @@ -1582,6 +1429,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, obj->update_completed.monitor_update_id); } @@ -1590,32 +1438,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t update_failed_ref = 0; CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); update_failed_ref = (uint64_t)update_failed_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVec_MonitorEventZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr); - arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1654,6 +1483,134 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeT default: abort(); } } +static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL; +static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL; +static jclass LDKClosureReason_HolderForceClosed_class = NULL; +static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL; +static jclass LDKClosureReason_CooperativeClosure_class = NULL; +static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL; +static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL; +static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL; +static jclass LDKClosureReason_ProcessingError_class = NULL; +static jmethodID LDKClosureReason_ProcessingError_meth = NULL; +static jclass LDKClosureReason_DisconnectedPeer_class = NULL; +static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL; +static jclass LDKClosureReason_OutdatedChannelManager_class = NULL; +static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) { + LDKClosureReason_CounterpartyForceClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;")); + CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL); + LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL); + LDKClosureReason_HolderForceClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;")); + CHECK(LDKClosureReason_HolderForceClosed_class != NULL); + LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "()V"); + CHECK(LDKClosureReason_HolderForceClosed_meth != NULL); + LDKClosureReason_CooperativeClosure_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;")); + CHECK(LDKClosureReason_CooperativeClosure_class != NULL); + LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "", "()V"); + CHECK(LDKClosureReason_CooperativeClosure_meth != NULL); + LDKClosureReason_CommitmentTxConfirmed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;")); + CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL); + LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "", "()V"); + CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL); + LDKClosureReason_ProcessingError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;")); + CHECK(LDKClosureReason_ProcessingError_class != NULL); + LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKClosureReason_ProcessingError_meth != NULL); + LDKClosureReason_DisconnectedPeer_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;")); + CHECK(LDKClosureReason_DisconnectedPeer_class != NULL); + LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "", "()V"); + CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL); + LDKClosureReason_OutdatedChannelManager_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;")); + CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL); + LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "", "()V"); + CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); + switch(obj->tag) { + case LDKClosureReason_CounterpartyForceClosed: { + LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; + jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len); + return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv); + } + case LDKClosureReason_HolderForceClosed: { + return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth); + } + case LDKClosureReason_CooperativeClosure: { + return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth); + } + case LDKClosureReason_CommitmentTxConfirmed: { + return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth); + } + case LDKClosureReason_ProcessingError: { + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv); + } + case LDKClosureReason_DisconnectedPeer: { + return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth); + } + case LDKClosureReason_OutdatedChannelManager: { + return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth); + } + default: abort(); + } +} +static jclass LDKCOption_ClosureReasonZ_Some_class = NULL; +static jmethodID LDKCOption_ClosureReasonZ_Some_meth = NULL; +static jclass LDKCOption_ClosureReasonZ_None_class = NULL; +static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) { + LDKCOption_ClosureReasonZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some;")); + CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL); + LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL); + LDKCOption_ClosureReasonZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None;")); + CHECK(LDKCOption_ClosureReasonZ_None_class != NULL); + LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "", "()V"); + CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_ClosureReasonZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_Some_class, LDKCOption_ClosureReasonZ_Some_meth, some_ref); + } + case LDKCOption_ClosureReasonZ_None: { + return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_None_class, LDKCOption_ClosureReasonZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; static jclass LDKNetworkUpdate_ChannelClosed_class = NULL; @@ -1685,6 +1642,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref); } @@ -1759,6 +1717,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t outpoint_ref = 0; CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); outpoint_ref = (uint64_t)outpoint_var.inner & ~1; uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (uint64_t)output_ref); @@ -1768,6 +1727,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t delayed_payment_output_ref = 0; CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var); delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref); } @@ -1776,32 +1736,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t static_payment_output_ref = 0; CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var); static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_SpendableOutputDescriptorZ *ret = MALLOC(sizeof(LDKCVec_SpendableOutputDescriptorZ), "LDKCVec_SpendableOutputDescriptorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVec_SpendableOutputDescriptorZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr); - arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) { LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1809,6 +1750,245 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } return ret; } +static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; +static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; +static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; +static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { + LDKPaymentPurpose_InvoicePayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;")); + CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); + LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[BJ)V"); + CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); + LDKPaymentPurpose_SpontaneousPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;")); + CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); + LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); + CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); + switch(obj->tag) { + case LDKPaymentPurpose_InvoicePayment: { + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); + int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); + return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id); + } + case LDKPaymentPurpose_SpontaneousPayment: { + int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); + return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); + } + default: abort(); + } +} +static jclass LDKEvent_FundingGenerationReady_class = NULL; +static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; +static jclass LDKEvent_PaymentReceived_class = NULL; +static jmethodID LDKEvent_PaymentReceived_meth = NULL; +static jclass LDKEvent_PaymentSent_class = NULL; +static jmethodID LDKEvent_PaymentSent_meth = NULL; +static jclass LDKEvent_PaymentPathFailed_class = NULL; +static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; +static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; +static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; +static jclass LDKEvent_SpendableOutputs_class = NULL; +static jmethodID LDKEvent_SpendableOutputs_meth = NULL; +static jclass LDKEvent_PaymentForwarded_class = NULL; +static jmethodID LDKEvent_PaymentForwarded_meth = NULL; +static jclass LDKEvent_ChannelClosed_class = NULL; +static jmethodID LDKEvent_ChannelClosed_meth = NULL; +static jclass LDKEvent_DiscardFunding_class = NULL; +static jmethodID LDKEvent_DiscardFunding_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { + LDKEvent_FundingGenerationReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); + CHECK(LDKEvent_FundingGenerationReady_class != NULL); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); + CHECK(LDKEvent_FundingGenerationReady_meth != NULL); + LDKEvent_PaymentReceived_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); + CHECK(LDKEvent_PaymentReceived_class != NULL); + LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([BJJ)V"); + CHECK(LDKEvent_PaymentReceived_meth != NULL); + LDKEvent_PaymentSent_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); + CHECK(LDKEvent_PaymentSent_class != NULL); + LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B[B[BJ)V"); + CHECK(LDKEvent_PaymentSent_meth != NULL); + LDKEvent_PaymentPathFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;")); + CHECK(LDKEvent_PaymentPathFailed_class != NULL); + LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); + CHECK(LDKEvent_PaymentPathFailed_meth != NULL); + LDKEvent_PendingHTLCsForwardable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); + CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); + LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); + CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); + LDKEvent_SpendableOutputs_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); + CHECK(LDKEvent_SpendableOutputs_class != NULL); + LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "([J)V"); + CHECK(LDKEvent_SpendableOutputs_meth != NULL); + LDKEvent_PaymentForwarded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;")); + CHECK(LDKEvent_PaymentForwarded_class != NULL); + LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JZ)V"); + CHECK(LDKEvent_PaymentForwarded_meth != NULL); + LDKEvent_ChannelClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;")); + CHECK(LDKEvent_ChannelClosed_class != NULL); + LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([BJJ)V"); + CHECK(LDKEvent_ChannelClosed_meth != NULL); + LDKEvent_DiscardFunding_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;")); + CHECK(LDKEvent_DiscardFunding_class != NULL); + LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "([B[B)V"); + CHECK(LDKEvent_DiscardFunding_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKEvent *obj = (LDKEvent*)(ptr & ~1); + switch(obj->tag) { + case LDKEvent_FundingGenerationReady: { + int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data); + LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; + int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen); + (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data); + return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_arr, obj->funding_generation_ready.user_channel_id); + } + case LDKEvent_PaymentReceived: { + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data); + uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref); + } + case LDKEvent_PaymentSent: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data); + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data); + uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref); + } + case LDKEvent_PaymentPathFailed: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data); + uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; + LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + uint64_t path_conv_10_ref = 0; + CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; + LDKRouteParameters retry_var = obj->payment_path_failed.retry; + uint64_t retry_ref = 0; + if ((uint64_t)retry_var.inner > 4096) { + CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var); + retry_ref = (uint64_t)retry_var.inner & ~1; + } + return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref); + } + case LDKEvent_PendingHTLCsForwardable: { + return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable); + } + case LDKEvent_SpendableOutputs: { + LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; + int64_tArray outputs_arr = NULL; + outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen); + int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL); + for (size_t b = 0; b < outputs_var.datalen; b++) { + uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; + outputs_arr_ptr[b] = outputs_conv_27_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0); + return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr); + } + case LDKEvent_PaymentForwarded: { + uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, obj->payment_forwarded.claim_from_onchain_tx); + } + case LDKEvent_ChannelClosed: { + int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data); + uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; + return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, obj->channel_closed.user_channel_id, reason_ref); + } + case LDKEvent_DiscardFunding: { + int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data); + LDKTransaction transaction_var = obj->discard_funding.transaction; + int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); + (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); + return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr); + } + default: abort(); + } +} +static jclass LDKCOption_EventZ_Some_class = NULL; +static jmethodID LDKCOption_EventZ_Some_meth = NULL; +static jclass LDKCOption_EventZ_None_class = NULL; +static jmethodID LDKCOption_EventZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) { + LDKCOption_EventZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$Some;")); + CHECK(LDKCOption_EventZ_Some_class != NULL); + LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_EventZ_Some_meth != NULL); + LDKCOption_EventZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$None;")); + CHECK(LDKCOption_EventZ_None_class != NULL); + LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "", "()V"); + CHECK(LDKCOption_EventZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_EventZ *obj = (LDKCOption_EventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_EventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_EventZ_Some_class, LDKCOption_EventZ_Some_meth, some_ref); + } + case LDKCOption_EventZ_None: { + return (*env)->NewObject(env, LDKCOption_EventZ_None_class, LDKCOption_EventZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} static jclass LDKErrorAction_DisconnectPeer_class = NULL; static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL; static jclass LDKErrorAction_IgnoreError_class = NULL; @@ -1848,6 +2028,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1 if ((uint64_t)msg_var.inner > 4096) { CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; } return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref); @@ -1864,6 +2045,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1 uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref); } @@ -2015,6 +2197,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref); } @@ -2025,6 +2208,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref); } @@ -2035,6 +2219,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref); } @@ -2045,6 +2230,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref); } @@ -2055,6 +2241,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref); } @@ -2065,6 +2252,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref); } @@ -2075,6 +2263,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t updates_ref = 0; CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var); updates_ref = (uint64_t)updates_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref); } @@ -2085,6 +2274,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref); } @@ -2095,6 +2285,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref); } @@ -2105,6 +2296,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref); } @@ -2115,6 +2307,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref); } @@ -2123,11 +2316,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; uint64_t update_msg_ref = 0; CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var); update_msg_ref = (uint64_t)update_msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref); } @@ -2136,6 +2331,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref); } @@ -2144,6 +2340,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref); } @@ -2154,6 +2351,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref); } @@ -2170,6 +2368,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref); } @@ -2180,6 +2379,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref); } @@ -2190,32 +2390,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_MessageSendEventZ *ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVec_MessageSendEventZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr); - arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) { LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2223,9 +2404,6 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InitFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2233,6 +2411,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2243,12 +2422,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2256,6 +2433,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2266,12 +2444,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2279,6 +2455,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeatures uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2289,12 +2466,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeatures uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2302,6 +2477,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeatures uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2312,12 +2488,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeatures uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2325,6 +2499,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParamete uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2335,12 +2510,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParamete uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2348,6 +2521,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2358,12 +2532,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2371,6 +2543,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentO uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2381,12 +2554,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentO uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2394,6 +2565,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOu uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2404,12 +2576,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOu uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2423,12 +2593,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutput uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneNoneZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneNoneZ *val = (LDKCResult_NoneNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2468,9 +2636,6 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2484,9 +2649,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1Signature CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignatureNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2596,6 +2758,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th holder_tx_var = HolderCommitmentTransaction_clone(holder_tx); CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); holder_tx_ref = (uint64_t)holder_tx_var.inner; if (holder_tx_var.is_owned) { holder_tx_ref |= 1; @@ -2610,7 +2773,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2654,6 +2817,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L commitment_tx_var = CommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -2668,7 +2832,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); - ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2695,7 +2859,7 @@ LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const vo void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2715,6 +2879,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -2729,7 +2894,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); - ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2760,7 +2925,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2786,6 +2951,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -2800,7 +2966,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2826,6 +2992,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -2840,7 +3007,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2860,6 +3027,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* closing_tx_var = ClosingTransaction_clone(closing_tx); CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var); closing_tx_ref = (uint64_t)closing_tx_var.inner; if (closing_tx_var.is_owned) { closing_tx_ref |= 1; @@ -2874,7 +3042,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2894,6 +3062,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void msg_var = UnsignedChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -2908,7 +3077,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2928,6 +3097,7 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); channel_parameters_ref = (uint64_t)channel_parameters_var.inner; if (channel_parameters_var.is_owned) { channel_parameters_ref |= 1; @@ -2980,7 +3150,7 @@ static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKBaseSign ret = { .this_arg = (void*) calls, @@ -3033,6 +3203,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1holder_ LDKHolderCommitmentTransaction holder_tx_conv; holder_tx_conv.inner = (void*)(holder_tx & (~1)); holder_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv); return (uint64_t)ret_conv; @@ -3054,6 +3225,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterpart LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -3079,6 +3251,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1com LDKHolderCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -3118,6 +3291,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1re LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_justice_revoked_htlc)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -3138,6 +3312,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterpart LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -3150,6 +3325,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1closing_1tr LDKClosingTransaction closing_tx_conv; closing_tx_conv.inner = (void*)(closing_tx & (~1)); closing_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv); return (uint64_t)ret_conv; @@ -3162,6 +3338,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1an LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -3174,6 +3351,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEn LDKChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv); } @@ -3190,6 +3368,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3264,7 +3443,7 @@ static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKSign ret = { .this_arg = (void*) calls, @@ -3298,9 +3477,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3315,12 +3491,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RecoverableSignatureNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RecoverableSignatureNoneZ *val = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3340,9 +3514,6 @@ static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *or } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_CVec_u8ZZNoneZ*)arg)->result_ok; -} JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3364,9 +3535,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNo CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InMemorySignerDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3374,6 +3542,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3384,29 +3553,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_TxOutZ *ret = MALLOC(sizeof(LDKCVec_TxOutZ), "LDKCVec_TxOutZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVec_TxOutZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr); - arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3414,9 +3564,6 @@ static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3449,6 +3596,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3456,26 +3604,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1BlockHashChannelMonitorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_BlockHashChannelMonitorZZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * ret->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) { LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3483,9 +3611,6 @@ static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashCh } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)arg)->result_ok; -} JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3611,15 +3736,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr uint64_t script_ref = 0; CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); script_ref = (uint64_t)script_var.inner & ~1; return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref); } default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3631,26 +3754,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1 uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CResult_1NoneAPIErrorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_CResult_NoneAPIErrorZZ *ret = MALLOC(sizeof(LDKCVec_CResult_NoneAPIErrorZZ), "LDKCVec_CResult_NoneAPIErrorZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * ret->datalen, "LDKCVec_CResult_NoneAPIErrorZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr); - arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) { LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3658,26 +3761,6 @@ static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(c } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1APIErrorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_APIErrorZ *ret = MALLOC(sizeof(LDKCVec_APIErrorZ), "LDKCVec_APIErrorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKAPIError) * ret->datalen, "LDKCVec_APIErrorZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr); - arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) { LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3685,9 +3768,6 @@ static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *or } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult__u832APIErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult__u832APIErrorZ *val = (LDKCResult__u832APIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3781,6 +3861,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ if ((uint64_t)failed_paths_retry_var.inner > 4096) { CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1; } int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -3790,9 +3871,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3806,9 +3884,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymen uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3840,9 +3915,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPay return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3913,26 +3985,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1p default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_NetAddressZ *ret = MALLOC(sizeof(LDKCVec_NetAddressZ), "LDKCVec_NetAddressZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVec_NetAddressZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr); - arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3960,9 +4012,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPay return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentSecretAPIErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3976,26 +4025,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAP uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_ChannelMonitorZ *ret = MALLOC(sizeof(LDKCVec_ChannelMonitorZ), "LDKCVec_ChannelMonitorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVec_ChannelMonitorZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKChannelMonitor arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelMonitor_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) { LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4041,6 +4070,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -4049,6 +4079,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t monitor_ref = 0; CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = (uint64_t)monitor_var.inner; if (monitor_var.is_owned) { monitor_ref |= 1; @@ -4063,7 +4094,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4082,6 +4113,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -4090,6 +4122,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t update_ref = 0; CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -4104,7 +4137,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4138,7 +4171,7 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1); CHECK_ACCESS(ret_conv_14_ptr); LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr); - ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1)); + FREE((void*)ret_conv_14); ret_constr.data[o] = ret_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -4186,10 +4219,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEn LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitor monitor_conv; monitor_conv.inner = (void*)(monitor & (~1)); monitor_conv.is_owned = (monitor & 1) || (monitor == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); monitor_conv = ChannelMonitor_clone(&monitor_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); @@ -4203,10 +4238,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIE LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = (update & 1) || (update == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); update_conv = ChannelMonitorUpdate_clone(&update_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); @@ -4414,7 +4451,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t LDKShutdownScript ret_conv; ret_conv.inner = (void*)(ret & (~1)); ret_conv.is_owned = (ret & 1) || (ret == 0); - ret_conv = ShutdownScript_clone(&ret_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4439,7 +4476,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKSign ret_conv = *(LDKSign*)(ret_ptr); - ret_conv = Sign_clone(&ret_conv); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4491,7 +4528,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr); - ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4520,7 +4557,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); - ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4598,6 +4635,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdow uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4752,7 +4790,7 @@ static void LDKLogger_JCalls_free(void* this_arg) { FREE(j_calls); } } -void log_LDKLogger_jcall(const void* this_arg, const char* record) { +void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -4761,11 +4799,19 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) { } else { DO_ASSERT(get_jenv_res == JNI_OK); } - const char* record_str = record; - jstring record_conv = str_ref_to_java(env, record_str, strlen(record_str)); + LDKRecord record_var = *record; + uint64_t record_ref = 0; + record_var = Record_clone(record); + CHECK((((uint64_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); + record_ref = (uint64_t)record_var.inner; + if (record_var.is_owned) { + record_ref |= 1; + } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_conv); + (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception."); @@ -4785,7 +4831,7 @@ static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) { atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V"); + calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V"); CHECK(calls->log_meth != NULL); LDKLogger ret = { @@ -4819,13 +4865,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner & ~1; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4840,12 +4884,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockH uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4853,6 +4895,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4863,12 +4906,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_OutPointDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4876,6 +4917,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4886,6 +4928,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5074,9 +5117,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1fro default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_COption_TypeZDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5090,6 +5130,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5129,6 +5170,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_ uint64_t routing_ref = 0; CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var); routing_ref = (uint64_t)routing_var.inner & ~1; return (*env)->NewObject(env, LDKPaymentError_Routing_class, LDKPaymentError_Routing_meth, routing_ref); } @@ -5139,9 +5181,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_ default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5155,9 +5194,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymen uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SiPrefixNoneZ*)arg)->result_ok; -} JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SiPrefixNoneZ *val = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5169,9 +5205,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5179,6 +5212,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1g uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5187,9 +5221,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_ CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignedRawInvoiceNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5197,6 +5228,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoic uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5214,6 +5246,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5240,6 +5273,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5247,9 +5281,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PayeePubKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5257,6 +5288,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5266,26 +5298,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyError jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1PrivateRouteZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_PrivateRouteZ *ret = MALLOC(sizeof(LDKCVec_PrivateRouteZ), "LDKCVec_PrivateRouteZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKPrivateRoute) * ret->datalen, "LDKCVec_PrivateRouteZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKPrivateRoute arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = PrivateRoute_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5293,9 +5305,6 @@ static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_Priva } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PositiveTimestampCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5303,6 +5312,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimesta uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5312,9 +5322,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestam jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneSemanticErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneSemanticErrorZ *val = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5326,9 +5333,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErro jclass err_conv = LDKSemanticError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceSemanticErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5336,6 +5340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemantic uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5345,9 +5350,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticE jclass err_conv = LDKSemanticError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DescriptionCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5355,6 +5357,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCrea uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5364,9 +5367,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreat jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ExpiryTimeCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5374,6 +5374,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreat uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5383,9 +5384,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreati jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PrivateRouteCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5393,6 +5391,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCre uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5402,9 +5401,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCrea jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_StringErrorZ*)arg)->result_ok; -} JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_StringErrorZ *val = (LDKCResult_StringErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5418,9 +5414,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1ge jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5428,6 +5421,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorU uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5438,11 +5432,55 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorU uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HTLCUpdateDecodeErrorZ*)arg)->result_ok; +static jclass LDKCOption_MonitorEventZ_Some_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL; +static jclass LDKCOption_MonitorEventZ_None_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some;")); + CHECK(LDKCOption_MonitorEventZ_Some_class != NULL); + LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL); + LDKCOption_MonitorEventZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$None;")); + CHECK(LDKCOption_MonitorEventZ_None_class != NULL); + LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "", "()V"); + CHECK(LDKCOption_MonitorEventZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_MonitorEventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref); + } + case LDKCOption_MonitorEventZ_None: { + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); @@ -5451,6 +5489,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5461,12 +5500,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5479,6 +5516,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpda uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5491,6 +5529,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1g uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5531,26 +5570,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1ge return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32ScriptZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_u32ScriptZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32ScriptZZ), "LDKCVec_C2Tuple_u32ScriptZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * ret->datalen, "LDKCVec_C2Tuple_u32ScriptZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5587,26 +5606,6 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2T return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5614,299 +5613,6 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV } return ret; } -static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; -static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; -static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; -static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { - LDKPaymentPurpose_InvoicePayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;")); - CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); - LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[BJ)V"); - CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); - LDKPaymentPurpose_SpontaneousPayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;")); - CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); - LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); - CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); - switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: { - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); - int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); - return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id); - } - case LDKPaymentPurpose_SpontaneousPayment: { - int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); - return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); - } - default: abort(); - } -} -static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL; -static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL; -static jclass LDKClosureReason_HolderForceClosed_class = NULL; -static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL; -static jclass LDKClosureReason_CooperativeClosure_class = NULL; -static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL; -static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL; -static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL; -static jclass LDKClosureReason_ProcessingError_class = NULL; -static jmethodID LDKClosureReason_ProcessingError_meth = NULL; -static jclass LDKClosureReason_DisconnectedPeer_class = NULL; -static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL; -static jclass LDKClosureReason_OutdatedChannelManager_class = NULL; -static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) { - LDKClosureReason_CounterpartyForceClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;")); - CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL); - LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL); - LDKClosureReason_HolderForceClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;")); - CHECK(LDKClosureReason_HolderForceClosed_class != NULL); - LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "()V"); - CHECK(LDKClosureReason_HolderForceClosed_meth != NULL); - LDKClosureReason_CooperativeClosure_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;")); - CHECK(LDKClosureReason_CooperativeClosure_class != NULL); - LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "", "()V"); - CHECK(LDKClosureReason_CooperativeClosure_meth != NULL); - LDKClosureReason_CommitmentTxConfirmed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;")); - CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL); - LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "", "()V"); - CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL); - LDKClosureReason_ProcessingError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;")); - CHECK(LDKClosureReason_ProcessingError_class != NULL); - LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKClosureReason_ProcessingError_meth != NULL); - LDKClosureReason_DisconnectedPeer_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;")); - CHECK(LDKClosureReason_DisconnectedPeer_class != NULL); - LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "", "()V"); - CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL); - LDKClosureReason_OutdatedChannelManager_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;")); - CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL); - LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "", "()V"); - CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); - switch(obj->tag) { - case LDKClosureReason_CounterpartyForceClosed: { - LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; - jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len); - return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv); - } - case LDKClosureReason_HolderForceClosed: { - return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth); - } - case LDKClosureReason_CooperativeClosure: { - return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth); - } - case LDKClosureReason_CommitmentTxConfirmed: { - return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth); - } - case LDKClosureReason_ProcessingError: { - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv); - } - case LDKClosureReason_DisconnectedPeer: { - return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth); - } - case LDKClosureReason_OutdatedChannelManager: { - return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth); - } - default: abort(); - } -} -static jclass LDKEvent_FundingGenerationReady_class = NULL; -static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; -static jclass LDKEvent_PaymentReceived_class = NULL; -static jmethodID LDKEvent_PaymentReceived_meth = NULL; -static jclass LDKEvent_PaymentSent_class = NULL; -static jmethodID LDKEvent_PaymentSent_meth = NULL; -static jclass LDKEvent_PaymentPathFailed_class = NULL; -static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; -static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; -static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; -static jclass LDKEvent_SpendableOutputs_class = NULL; -static jmethodID LDKEvent_SpendableOutputs_meth = NULL; -static jclass LDKEvent_PaymentForwarded_class = NULL; -static jmethodID LDKEvent_PaymentForwarded_meth = NULL; -static jclass LDKEvent_ChannelClosed_class = NULL; -static jmethodID LDKEvent_ChannelClosed_meth = NULL; -static jclass LDKEvent_DiscardFunding_class = NULL; -static jmethodID LDKEvent_DiscardFunding_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { - LDKEvent_FundingGenerationReady_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); - CHECK(LDKEvent_FundingGenerationReady_class != NULL); - LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); - CHECK(LDKEvent_FundingGenerationReady_meth != NULL); - LDKEvent_PaymentReceived_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); - CHECK(LDKEvent_PaymentReceived_class != NULL); - LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([BJJ)V"); - CHECK(LDKEvent_PaymentReceived_meth != NULL); - LDKEvent_PaymentSent_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); - CHECK(LDKEvent_PaymentSent_class != NULL); - LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B[B[BJ)V"); - CHECK(LDKEvent_PaymentSent_meth != NULL); - LDKEvent_PaymentPathFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;")); - CHECK(LDKEvent_PaymentPathFailed_class != NULL); - LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); - CHECK(LDKEvent_PaymentPathFailed_meth != NULL); - LDKEvent_PendingHTLCsForwardable_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); - CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); - LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); - CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); - LDKEvent_SpendableOutputs_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); - CHECK(LDKEvent_SpendableOutputs_class != NULL); - LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "([J)V"); - CHECK(LDKEvent_SpendableOutputs_meth != NULL); - LDKEvent_PaymentForwarded_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;")); - CHECK(LDKEvent_PaymentForwarded_class != NULL); - LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JZ)V"); - CHECK(LDKEvent_PaymentForwarded_meth != NULL); - LDKEvent_ChannelClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;")); - CHECK(LDKEvent_ChannelClosed_class != NULL); - LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([BJJ)V"); - CHECK(LDKEvent_ChannelClosed_meth != NULL); - LDKEvent_DiscardFunding_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;")); - CHECK(LDKEvent_DiscardFunding_class != NULL); - LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "([B[B)V"); - CHECK(LDKEvent_DiscardFunding_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKEvent *obj = (LDKEvent*)(ptr & ~1); - switch(obj->tag) { - case LDKEvent_FundingGenerationReady: { - int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data); - LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; - int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen); - (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data); - return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_arr, obj->funding_generation_ready.user_channel_id); - } - case LDKEvent_PaymentReceived: { - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data); - uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref); - } - case LDKEvent_PaymentSent: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data); - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data); - uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref); - } - case LDKEvent_PaymentPathFailed: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data); - uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; - LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; - LDKRouteParameters retry_var = obj->payment_path_failed.retry; - uint64_t retry_ref = 0; - if ((uint64_t)retry_var.inner > 4096) { - CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - retry_ref = (uint64_t)retry_var.inner & ~1; - } - return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref); - } - case LDKEvent_PendingHTLCsForwardable: { - return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable); - } - case LDKEvent_SpendableOutputs: { - LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; - int64_tArray outputs_arr = NULL; - outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen); - int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL); - for (size_t b = 0; b < outputs_var.datalen; b++) { - uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; - outputs_arr_ptr[b] = outputs_conv_27_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0); - return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr); - } - case LDKEvent_PaymentForwarded: { - uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, obj->payment_forwarded.claim_from_onchain_tx); - } - case LDKEvent_ChannelClosed: { - int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data); - uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; - return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, obj->channel_closed.user_channel_id, reason_ref); - } - case LDKEvent_DiscardFunding: { - int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); - (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); - return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr); - } - default: abort(); - } -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_EventZ *ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVec_EventZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr); - arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5933,26 +5639,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b( return (uint64_t)ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_u32TxOutZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32TxOutZZ), "LDKCVec_C2Tuple_u32TxOutZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * ret->datalen, "LDKCVec_C2Tuple_u32TxOutZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) { LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5989,26 +5675,6 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2T return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6064,26 +5730,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr( default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1BalanceZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_BalanceZ *ret = MALLOC(sizeof(LDKCVec_BalanceZ), "LDKCVec_BalanceZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKBalance) * ret->datalen, "LDKCVec_BalanceZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr); - arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) { LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6091,9 +5737,6 @@ static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6109,12 +5752,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockH uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneLightningErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6127,6 +5768,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6150,26 +5792,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1ge return (uint64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1PublicKeyTypeZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_PublicKeyTypeZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_PublicKeyTypeZZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * ret->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) { LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6177,9 +5799,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok; -} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6192,6 +5811,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6204,6 +5824,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6220,6 +5841,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6236,6 +5858,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6243,26 +5866,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * ret->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr); - arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6270,26 +5873,6 @@ static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CV } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_NodeAnnouncementZ *ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVec_NodeAnnouncementZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKNodeAnnouncement arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = NodeAnnouncement_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6297,9 +5880,6 @@ static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCV } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6315,12 +5895,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHa uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6333,12 +5911,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6351,12 +5927,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeIdDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6364,6 +5938,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6374,6 +5949,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6421,7 +6014,7 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); - ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6501,9 +6094,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1f default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DirectionalChannelInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6511,6 +6101,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6521,12 +6112,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6534,6 +6123,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6544,12 +6134,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RoutingFeesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6557,6 +6145,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6567,12 +6156,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6580,6 +6167,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6590,32 +6178,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_u64Z *ret = MALLOC(sizeof(LDKCVec_u64Z), "LDKCVec_u64Z"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVec_u64Z Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6623,6 +6194,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6633,12 +6205,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NetworkGraphDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6646,6 +6216,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6656,6 +6227,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6696,9 +6268,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddres default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6712,29 +6281,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateAddHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateAddHTLCZ), "LDKCVec_UpdateAddHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVec_UpdateAddHTLCZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKUpdateAddHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateAddHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) { LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6742,26 +6292,6 @@ static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_Upd } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFulfillHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFulfillHTLCZ), "LDKCVec_UpdateFulfillHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVec_UpdateFulfillHTLCZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKUpdateFulfillHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFulfillHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) { LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6769,26 +6299,6 @@ static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDK } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFailHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailHTLCZ), "LDKCVec_UpdateFailHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVec_UpdateFailHTLCZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKUpdateFailHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) { LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6796,26 +6306,6 @@ static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_U } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFailMalformedHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailMalformedHTLCZ), "LDKCVec_UpdateFailMalformedHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVec_UpdateFailMalformedHTLCZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKUpdateFailMalformedHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailMalformedHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) { LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6823,9 +6313,6 @@ static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clo } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_AcceptChannelDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6833,6 +6320,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6843,12 +6331,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_AnnouncementSignaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6856,6 +6342,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSig uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6866,12 +6353,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSig uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelReestablishDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6879,6 +6364,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestabl uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6889,12 +6375,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestabl uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ClosingSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6902,6 +6386,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6912,12 +6397,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6925,6 +6408,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6935,12 +6419,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CommitmentSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6948,6 +6430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSigne uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6958,12 +6441,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSigne uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingCreatedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6971,6 +6452,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6981,12 +6463,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6994,6 +6474,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7004,12 +6485,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingLockedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7017,6 +6496,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7027,12 +6507,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InitDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7040,6 +6518,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7050,12 +6529,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_OpenChannelDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7063,6 +6540,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7073,12 +6551,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RevokeAndACKDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7086,6 +6562,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7096,12 +6573,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7109,6 +6584,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7119,12 +6595,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFailHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7132,6 +6606,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7142,12 +6617,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7155,6 +6628,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalfo uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7165,12 +6639,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalfo uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFeeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7178,6 +6650,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7188,12 +6661,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7201,6 +6672,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHT uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7211,12 +6683,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHT uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateAddHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7224,6 +6694,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7234,12 +6705,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PingDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7247,6 +6716,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7257,12 +6727,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PongDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7270,6 +6738,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7280,12 +6749,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7293,6 +6760,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7303,12 +6771,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7316,6 +6782,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounce uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7326,12 +6793,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounce uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7339,6 +6804,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7349,12 +6815,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7362,6 +6826,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7372,12 +6837,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ErrorMessageDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7385,6 +6848,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7395,12 +6859,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7408,6 +6870,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnn uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7418,12 +6881,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnn uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7431,6 +6892,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7441,12 +6903,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7454,6 +6914,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChann uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7464,12 +6925,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChann uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7477,6 +6936,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChann uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7487,12 +6947,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChann uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_QueryChannelRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7500,6 +6958,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7510,12 +6969,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7523,6 +6980,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7533,12 +6991,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7546,6 +7002,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestamp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7556,6 +7013,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestamp uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -7588,9 +7046,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceSignOrCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7598,6 +7053,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7669,6 +7125,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void uint64_t output_ref = 0; CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = (uint64_t)output_var.inner; if (output_var.is_owned) { output_ref |= 1; @@ -7683,7 +7140,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr); - ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7740,6 +7197,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JN LDKWatchedOutput output_conv; output_conv.inner = (void*)(output & (~1)); output_conv.is_owned = (output & 1) || (output == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv); output_conv = WatchedOutput_clone(&output_conv); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); @@ -7782,9 +7240,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1f default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_LockedChannelMonitorNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -7792,6 +7247,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMo uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7800,26 +7256,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonit CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1OutPointZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_OutPointZ *ret = MALLOC(sizeof(LDKCVec_OutPointZ), "LDKCVec_OutPointZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKOutPoint) * ret->datalen, "LDKCVec_OutPointZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKOutPoint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = OutPoint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) { LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -7878,7 +7314,7 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1); CHECK_ACCESS(ret_conv_18_ptr); LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr); - ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1)); + FREE((void*)ret_conv_18); ret_constr.data[s] = ret_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -8492,6 +7928,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -8501,6 +7938,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -8509,6 +7947,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -8523,7 +7962,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8542,6 +7981,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -8552,6 +7992,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal update_var = ChannelMonitorUpdate_clone(update); CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -8562,6 +8003,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -8570,6 +8012,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -8584,7 +8027,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8626,13 +8069,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1chan LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv); @@ -8646,16 +8092,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_ LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv); @@ -8720,6 +8170,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8729,6 +8180,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = OpenChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8759,6 +8211,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8768,6 +8221,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = AcceptChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8799,6 +8253,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingCreated_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8830,6 +8285,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8861,6 +8317,7 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingLocked_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8892,6 +8349,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub their_features_var = InitFeatures_clone(their_features); CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8901,6 +8359,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = Shutdown_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8932,6 +8391,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ClosingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8963,6 +8423,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8994,6 +8455,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9025,6 +8487,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9056,6 +8519,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9087,6 +8551,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9118,6 +8583,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9149,6 +8615,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9180,6 +8647,7 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9233,6 +8701,7 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl msg_var = Init_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9264,6 +8733,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9295,6 +8765,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9326,6 +8797,7 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9443,10 +8915,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -9460,10 +8934,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -9477,6 +8953,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9490,6 +8967,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9503,6 +8981,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9516,9 +8995,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv); } @@ -9532,6 +9013,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9545,6 +9027,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateAddHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9558,6 +9041,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFulfillHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9571,6 +9055,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFailHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9584,6 +9069,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFailMalformedHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9597,6 +9083,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKCommitmentSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9610,6 +9097,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9623,6 +9111,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFee msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9636,6 +9125,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9659,6 +9149,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1c LDKInit msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9672,6 +9163,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9685,6 +9177,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9698,6 +9191,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9748,6 +9242,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_var = NodeAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9762,7 +9257,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9782,6 +9277,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_var = ChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9796,7 +9292,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9816,6 +9312,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9830,7 +9327,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9864,7 +9361,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1); CHECK_ACCESS(ret_conv_59_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr); - ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1)); + FREE((void*)ret_conv_59); ret_constr.data[h] = ret_conv_59_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -9903,7 +9400,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j LDKNodeAnnouncement ret_conv_18_conv; ret_conv_18_conv.inner = (void*)(ret_conv_18 & (~1)); ret_conv_18_conv.is_owned = (ret_conv_18 & 1) || (ret_conv_18 == 0); - ret_conv_18_conv = NodeAnnouncement_clone(&ret_conv_18_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv); ret_constr.data[s] = ret_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -9928,6 +9425,7 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK init_var = Init_clone(init); CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = (uint64_t)init_var.inner; if (init_var.is_owned) { init_ref |= 1; @@ -9958,6 +9456,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9972,7 +9471,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9993,6 +9492,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10007,7 +9507,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10028,6 +9528,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10042,7 +9543,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10063,6 +9564,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10077,7 +9579,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10152,6 +9654,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10164,6 +9667,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10176,6 +9680,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10215,6 +9720,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_ uint64_t ret_conv_18_ref = 0; CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var); ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner; if (ret_conv_18_var.is_owned) { ret_conv_18_ref |= 1; @@ -10236,6 +9742,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1r LDKInit init_conv; init_conv.inner = (void*)(init & (~1)); init_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv); (this_arg_conv->sync_routing_table)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); } @@ -10249,6 +9756,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10265,6 +9773,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKReplyShortChannelIdsEnd msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10281,6 +9790,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10297,6 +9807,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10348,7 +9859,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); - ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10441,7 +9952,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10475,7 +9986,7 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1); CHECK_ACCESS(ret_conv_25_ptr); LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr); - ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1)); + FREE((void*)ret_conv_25); ret_constr.data[z] = ret_conv_25_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -10775,6 +10286,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor source_var = NodeId_clone(source); CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); source_ref = (uint64_t)source_var.inner; if (source_var.is_owned) { source_ref |= 1; @@ -10784,6 +10296,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor target_var = NodeId_clone(target); CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); target_ref = (uint64_t)target_var.inner; if (target_var.is_owned) { target_ref |= 1; @@ -10818,6 +10331,7 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t path_conv_10_ref = 0; CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); path_conv_10_ref = (uint64_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; @@ -10901,9 +10415,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1ms LDKNodeId source_conv; source_conv.inner = (void*)(source & (~1)); source_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); LDKNodeId target_conv; target_conv.inner = (void*)(target & (~1)); target_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv); return ret_val; } @@ -10924,6 +10440,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(J LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -10979,6 +10496,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi // Warning: we may need a move here but no clone is available for LDKChannelManager CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = (uint64_t)channel_manager_var.inner; if (channel_manager_var.is_owned) { channel_manager_ref |= 1; @@ -10993,7 +10511,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); - ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11032,6 +10550,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerPersister_1pe LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); return (uint64_t)ret_conv; @@ -11161,7 +10680,7 @@ LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { LDKChannelDetails ret_conv_16_conv; ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1)); ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0); - ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); ret_constr.data[q] = ret_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -11184,6 +10703,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -11202,7 +10722,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11222,6 +10742,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -11238,7 +10759,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11301,6 +10822,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNI uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -11319,6 +10841,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment(JNIEnv LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -11337,6 +10860,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEn LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); @@ -11384,6 +10908,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, params_var = RouteParameters_clone(params); CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); params_ref = (uint64_t)params_var.inner; if (params_var.is_owned) { params_ref |= 1; @@ -11399,6 +10924,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, uint64_t first_hops_conv_16_ref = 0; CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner; if (first_hops_conv_16_var.is_owned) { first_hops_conv_16_ref |= 1; @@ -11419,7 +10945,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); - ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11461,6 +10987,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -11475,6 +11002,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); @@ -11531,6 +11059,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclas TxOut_free(_res_conv); } +static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(arg); + return (uint64_t)ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxOut* arg_conv = (LDKTxOut*)(arg & ~1); + int64_t ret_val = TxOut_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); @@ -11559,6 +11098,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_SecretKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11584,6 +11129,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PublicKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11593,6 +11144,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free CResult_PublicKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)(orig & ~1); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); @@ -11604,6 +11166,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDeco LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); @@ -11614,12 +11177,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11629,6 +11199,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeE CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); @@ -11640,6 +11221,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD LDKChannelPublicKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelPublicKeys_clone(&o_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); @@ -11650,12 +11232,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11665,6 +11254,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDeco CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); @@ -11676,6 +11276,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErro LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); @@ -11689,6 +11290,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErro return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11698,6 +11305,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_ CResult_TxCreationKeysErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); @@ -11728,6 +11346,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *en COption_u32Z_free(_res_conv); } +static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)arg; + int64_t ret_val = COption_u32Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); @@ -11740,6 +11370,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommit LDKHTLCOutputInCommitment o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCOutputInCommitment_clone(&o_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); @@ -11750,12 +11381,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommit LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11765,6 +11403,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmen CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); @@ -11776,6 +11425,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChanne LDKCounterpartyChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -11786,12 +11436,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChanne LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11801,6 +11458,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTr CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); @@ -11812,6 +11480,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransaction LDKChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelTransactionParameters_clone(&o_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -11822,12 +11491,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransaction LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11837,6 +11513,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionPar CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); @@ -11865,6 +11552,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTr LDKHolderCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HolderCommitmentTransaction_clone(&o_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11875,12 +11563,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11890,6 +11585,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTrans CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); @@ -11901,6 +11607,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTra LDKBuiltCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = BuiltCommitmentTransaction_clone(&o_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11911,12 +11618,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTra LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11926,6 +11640,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransa CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); @@ -11937,6 +11662,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTran LDKTrustedClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedClosingTransaction LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); @@ -11949,6 +11675,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTran return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11962,6 +11694,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransact LDKCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentTransaction_clone(&o_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11972,12 +11705,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransact LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11987,6 +11727,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); @@ -11998,6 +11749,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentT LDKTrustedCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedCommitmentTransaction LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); @@ -12010,6 +11762,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentT return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12044,6 +11802,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_SignatureZNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12053,6 +11817,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ CResult_CVec_SignatureZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)(orig & ~1); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); @@ -12064,6 +11839,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDeco LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); @@ -12074,12 +11850,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12089,6 +11872,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeE CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); @@ -12100,6 +11894,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); @@ -12110,12 +11905,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva LDKInvalidShutdownScript e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = InvalidShutdownScript_clone(&e_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12125,6 +11927,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalid CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); @@ -12145,6 +11958,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err(JN return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12154,6 +11973,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIE CResult_NoneErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)(orig & ~1); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); @@ -12165,6 +11995,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHop_clone(&o_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv); @@ -12175,12 +12006,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12190,6 +12028,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_ CResult_RouteHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); @@ -12210,6 +12059,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * LDKRouteHop _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12237,6 +12087,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(J LDKRouteHop _res_conv_12_conv_10_conv; _res_conv_12_conv_10_conv.inner = (void*)(_res_conv_12_conv_10 & (~1)); _res_conv_12_conv_10_conv.is_owned = (_res_conv_12_conv_10 & 1) || (_res_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv); _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res_conv_12, _res_conv_12_vals, 0); @@ -12249,6 +12100,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_ LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv); @@ -12259,12 +12111,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12274,6 +12133,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1fr CResult_RouteDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = CResult_RouteDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)(orig & ~1); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); @@ -12285,6 +12155,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDec LDKRouteParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteParameters_clone(&o_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv); @@ -12295,12 +12166,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12310,6 +12188,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecode CResult_RouteParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); @@ -12330,6 +12219,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv LDKRouteHint _res_conv_11_conv; _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1)); _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv); _res_constr.data[l] = _res_conv_11_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12359,6 +12249,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *en COption_u64Z_free(_res_conv); } +static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)arg; + int64_t ret_val = COption_u64Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); @@ -12371,6 +12273,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_ LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Payee_clone(&o_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv); @@ -12381,12 +12284,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PayeeDecodeErrorZ* o_conv = (LDKCResult_PayeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12396,6 +12306,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1fr CResult_PayeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); + *ret_conv = CResult_PayeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PayeeDecodeErrorZ* arg_conv = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); @@ -12416,6 +12337,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIE LDKRouteHintHop _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12426,6 +12348,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErr LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHint_clone(&o_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv); @@ -12436,12 +12359,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12451,6 +12381,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); @@ -12462,6 +12403,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHintHop_clone(&o_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv); @@ -12472,12 +12414,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12487,6 +12436,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErr CResult_RouteHintHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); @@ -12507,6 +12467,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JN LDKChannelDetails _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12517,6 +12478,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); @@ -12527,12 +12489,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12542,6 +12511,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_ CResult_RouteLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); @@ -12566,6 +12546,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxOutAccessErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12575,6 +12561,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1fr CResult_TxOutAccessErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); @@ -12582,6 +12579,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_ return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); + int64_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); @@ -12659,6 +12667,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitor return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); + jboolean ret_val = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12668,6 +12682,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpd CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); } +static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); + int64_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); @@ -12722,6 +12747,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransac COption_C2Tuple_usizeTransactionZZ_free(_res_conv); } +static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; + int64_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); @@ -12730,6 +12767,107 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTran return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); + o_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)o) & ~1)); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); + FREE((void*)_res); + COption_ClosureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)arg; + int64_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)orig; + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uint64_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -12757,6 +12895,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free( COption_NetworkUpdateZ_free(_res_conv); } +static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) { + LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); + *ret_copy = COption_NetworkUpdateZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)arg; + int64_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)orig; LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); @@ -12785,6 +12935,107 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescripto CVec_SpendableOutputDescriptorZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKEvent o_conv = *(LDKEvent*)(o_ptr); + o_conv = Event_clone((LDKEvent*)(((uint64_t)o) & ~1)); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); + FREE((void*)_res); + COption_EventZ_free(_res_conv); +} + +static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)arg; + int64_t ret_val = COption_EventZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)orig; + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_MessageSendEventZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -12809,6 +13060,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecode LDKInitFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InitFeatures_clone(&o_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); @@ -12819,12 +13071,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12838,6 +13097,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecode LDKNodeFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeFeatures_clone(&o_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); @@ -12848,12 +13108,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12867,6 +13134,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDec LDKChannelFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelFeatures_clone(&o_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); @@ -12877,12 +13145,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12896,6 +13171,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDec LDKInvoiceFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InvoiceFeatures_clone(&o_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); @@ -12906,12 +13182,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12925,6 +13208,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD LDKScoringParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); @@ -12935,12 +13219,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12954,6 +13245,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ LDKScorer o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScorer LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv); @@ -12964,12 +13256,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12983,6 +13282,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutp LDKDelayedPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -12993,12 +13293,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutp LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13008,6 +13315,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputD CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); @@ -13019,6 +13337,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu LDKStaticPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -13029,12 +13348,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13044,6 +13370,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDe CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); @@ -13065,12 +13402,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDes LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13080,6 +13424,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescri CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); @@ -13099,6 +13454,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNI return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)(o & ~1); + jboolean ret_val = CResult_NoneNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13108,6 +13469,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEn CResult_NoneNoneZ_free(_res_conv); } +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)(arg & ~1); + int64_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)(orig & ~1); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); @@ -13115,6 +13487,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(J return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); @@ -13169,6 +13552,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Signature return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13178,6 +13567,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVe CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); @@ -13200,6 +13600,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1er return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignatureNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13209,6 +13615,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free( CResult_SignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); @@ -13233,12 +13650,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SignDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13248,6 +13672,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1fre CResult_SignDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); @@ -13278,6 +13713,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatu return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13287,6 +13728,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureN CResult_RecoverableSignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); @@ -13338,6 +13790,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13347,6 +13805,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); @@ -13358,6 +13827,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDeco LDKInMemorySigner o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InMemorySigner_clone(&o_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); @@ -13368,12 +13838,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13383,6 +13860,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeE CResult_InMemorySignerDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); @@ -13427,6 +13915,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1 return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13436,6 +13930,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1fre CResult_TransactionNoneZ_free(_res_conv); } +static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); + int64_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); @@ -13443,6 +13948,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1 return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); + int64_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); @@ -13457,6 +13973,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo LDKChannelMonitor b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelMonitor_clone(&b_conv); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); @@ -13521,6 +14038,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1Blo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13530,6 +14053,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockH CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); @@ -13560,6 +14094,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *en COption_u16Z_free(_res_conv); } +static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; + int64_t ret_val = COption_u16Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); @@ -13584,6 +14130,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneAPIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13593,6 +14145,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(J CResult_NoneAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)(orig & ~1); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); @@ -13659,6 +14222,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); + jboolean ret_val = CResult__u832APIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13668,6 +14237,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free CResult__u832APIErrorZ_free(_res_conv); } +static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); + int64_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); @@ -13694,6 +14274,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSe return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13703,6 +14289,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendF CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); @@ -13726,6 +14323,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_NonePaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13735,6 +14338,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailur CResult_NonePaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)(orig & ~1); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); @@ -13742,6 +14356,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); @@ -13790,6 +14415,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHa return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13799,6 +14430,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashP CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); @@ -13826,6 +14468,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv CVec_NetAddressZ_free(_res_constr); } +static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); @@ -13873,6 +14526,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIEr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13882,6 +14541,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIError CResult_PaymentSecretAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); @@ -13902,6 +14572,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JN LDKChannelMonitor _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -13915,6 +14586,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa LDKChannelManager b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); // Warning: we need a move here but no clone is available for LDKChannelManager LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); @@ -13944,12 +14616,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13963,6 +14642,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod LDKChannelConfig o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelConfig_clone(&o_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); @@ -13973,12 +14653,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13988,6 +14675,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeEr CResult_ChannelConfigDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); @@ -13999,6 +14697,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErro LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OutPoint_clone(&o_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); @@ -14009,12 +14708,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OutPointDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14024,6 +14730,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_ CResult_OutPointDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); @@ -14061,6 +14778,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *e COption_TypeZ_free(_res_conv); } +static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; + int64_t ret_val = COption_TypeZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); @@ -14083,12 +14812,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14098,6 +14834,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeE CResult_COption_TypeZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); @@ -14124,6 +14871,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentEr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14133,6 +14886,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentError CResult_PaymentIdPaymentErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); @@ -14153,6 +14917,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1err return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SiPrefixNoneZ* o_conv = (LDKCResult_SiPrefixNoneZ*)(o & ~1); + jboolean ret_val = CResult_SiPrefixNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14162,6 +14932,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(J CResult_SiPrefixNoneZ_free(_res_conv); } +static inline uint64_t CResult_SiPrefixNoneZ_clone_ptr(LDKCResult_SiPrefixNoneZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); + *ret_conv = CResult_SiPrefixNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SiPrefixNoneZ* arg_conv = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SiPrefixNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SiPrefixNoneZ* orig_conv = (LDKCResult_SiPrefixNoneZ*)(orig & ~1); LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); @@ -14173,6 +14954,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1ok(J LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); *ret_conv = CResult_InvoiceNoneZ_ok(o_conv); @@ -14185,6 +14967,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1err( return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceNoneZ* o_conv = (LDKCResult_InvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14194,6 +14982,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JN CResult_InvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceNoneZ_clone_ptr(LDKCResult_InvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); + *ret_conv = CResult_InvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceNoneZ* arg_conv = (LDKCResult_InvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceNoneZ* orig_conv = (LDKCResult_InvoiceNoneZ*)(orig & ~1); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); @@ -14205,6 +15004,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = SignedRawInvoice_clone(&o_conv); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); *ret_conv = CResult_SignedRawInvoiceNoneZ_ok(o_conv); @@ -14217,6 +15017,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignedRawInvoiceNoneZ* o_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignedRawInvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14226,6 +15032,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignedRawInvoiceNoneZ_clone_ptr(LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); + *ret_conv = CResult_SignedRawInvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignedRawInvoiceNoneZ* arg_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignedRawInvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignedRawInvoiceNoneZ* orig_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(orig & ~1); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); @@ -14233,6 +15050,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); + int64_t ret_val = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); @@ -14244,6 +15072,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = RawInvoice_clone(&a_conv); LDKThirtyTwoBytes b_ref; CHECK((*env)->GetArrayLength(env, b) == 32); @@ -14251,6 +15080,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In LDKInvoiceSignature c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = InvoiceSignature_clone(&c_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); @@ -14270,6 +15100,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_ LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PayeePubKey_clone(&o_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); @@ -14283,6 +15114,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeePubKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14292,6 +15129,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1fr CResult_PayeePubKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); @@ -14312,6 +15160,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIE LDKPrivateRoute _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -14322,6 +15171,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampC LDKPositiveTimestamp o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PositiveTimestamp_clone(&o_conv); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); @@ -14335,6 +15185,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampC return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14344,6 +15200,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCrea CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); @@ -14364,6 +15231,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14373,6 +15246,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1f CResult_NoneSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); @@ -14384,6 +15268,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErr LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); @@ -14397,6 +15282,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14406,6 +15297,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); @@ -14417,6 +15319,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreatio LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Description_clone(&o_conv); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); @@ -14430,6 +15333,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreatio return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_DescriptionCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14439,6 +15348,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationEr CResult_DescriptionCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); @@ -14450,6 +15370,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreation LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ExpiryTime_clone(&o_conv); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); *ret_conv = CResult_ExpiryTimeCreationErrorZ_ok(o_conv); @@ -14463,6 +15384,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreation return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ExpiryTimeCreationErrorZ* o_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_ExpiryTimeCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14472,6 +15399,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErr CResult_ExpiryTimeCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_ExpiryTimeCreationErrorZ_clone_ptr(LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); + *ret_conv = CResult_ExpiryTimeCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ExpiryTimeCreationErrorZ* arg_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ExpiryTimeCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ExpiryTimeCreationErrorZ* orig_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(orig & ~1); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); @@ -14483,6 +15421,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreati LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PrivateRoute_clone(&o_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); @@ -14496,6 +15435,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreati return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14505,6 +15450,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationE CResult_PrivateRouteCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); @@ -14526,6 +15482,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err( return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); + jboolean ret_val = CResult_StringErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14539,6 +15501,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda LDKChannelMonitorUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelMonitorUpdate_clone(&o_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); @@ -14549,12 +15512,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14564,6 +15534,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateD CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); @@ -14571,10 +15552,112 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda return (uint64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)o) & ~1)); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); + FREE((void*)_res); + COption_MonitorEventZ_free(_res_conv); +} + +static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; + int64_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKHTLCUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCUpdate_clone(&o_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); @@ -14585,12 +15668,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14600,6 +15690,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeError CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); @@ -14617,12 +15718,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateE LDKMonitorUpdateError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = MonitorUpdateError_clone(&e_conv); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14632,6 +15740,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErro CResult_NoneMonitorUpdateErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); + *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); @@ -14639,6 +15758,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateE return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); @@ -14650,6 +15780,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1n LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKCVec_u8Z b_ref; b_ref.datalen = (*env)->GetArrayLength(env, b); @@ -14669,6 +15800,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free C2Tuple_OutPointScriptZ_free(_res_conv); } +static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); @@ -14715,6 +15857,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1fr CVec_C2Tuple_u32ScriptZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); @@ -14815,6 +15968,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEn CVec_TransactionZ_free(_res_constr); } +static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); @@ -14861,6 +16025,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1fre CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); @@ -14956,12 +16131,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14971,6 +16153,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashCha CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); @@ -14988,12 +16181,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningError LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15003,6 +16203,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1 CResult_NoneLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); @@ -15010,6 +16221,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningError return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); @@ -15072,12 +16294,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningError LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15087,6 +16316,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1 CResult_boolLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); @@ -15094,6 +16334,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningError return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); + int64_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); @@ -15105,14 +16356,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen LDKChannelAnnouncement a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = ChannelAnnouncement_clone(&a_conv); LDKChannelUpdate b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelUpdate_clone(&b_conv); LDKChannelUpdate c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = ChannelUpdate_clone(&c_conv); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); @@ -15161,6 +16415,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free( LDKNodeAnnouncement _res_conv_18_conv; _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); _res_constr.data[s] = _res_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15198,12 +16453,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandl LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15213,6 +16475,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleEr CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); @@ -15230,12 +16503,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErro LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_NonePeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15245,6 +16525,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_ CResult_NonePeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); @@ -15262,12 +16553,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErro LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15277,6 +16575,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_ CResult_boolPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); @@ -15288,6 +16597,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeId_clone(&o_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); @@ -15298,12 +16608,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15313,6 +16630,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1f CResult_NodeIdDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); @@ -15320,6 +16648,60 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ return (uint64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uint64_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -15354,6 +16736,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannel LDKDirectionalChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DirectionalChannelInfo_clone(&o_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_ok(o_conv); @@ -15364,12 +16747,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannel LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* o_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15379,6 +16769,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInf CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); + *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); @@ -15390,6 +16791,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeE LDKChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelInfo_clone(&o_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); @@ -15400,12 +16802,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15415,6 +16824,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErro CResult_ChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); @@ -15426,6 +16846,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeE LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RoutingFees_clone(&o_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); @@ -15436,12 +16857,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15451,6 +16879,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErro CResult_RoutingFeesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); @@ -15462,6 +16901,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementIn LDKNodeAnnouncementInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncementInfo_clone(&o_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); @@ -15472,12 +16912,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementIn LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15487,6 +16934,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoD CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); @@ -15514,6 +16972,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErro LDKNodeInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeInfo_clone(&o_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); @@ -15524,12 +16983,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15539,6 +17005,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_ CResult_NodeInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); @@ -15550,6 +17027,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecode LDKNetworkGraph o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NetworkGraph_clone(&o_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); @@ -15560,12 +17038,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15575,6 +17060,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErr CResult_NetworkGraphDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); @@ -15621,6 +17117,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1f COption_CVec_NetAddressZZ_free(_res_conv); } +static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; + int64_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); @@ -15643,12 +17151,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetAddressDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15658,6 +17173,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeError CResult_NetAddressDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); @@ -15678,6 +17204,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNI LDKUpdateAddHTLC _res_conv_15_conv; _res_conv_15_conv.inner = (void*)(_res_conv_15 & (~1)); _res_conv_15_conv.is_owned = (_res_conv_15 & 1) || (_res_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv); _res_constr.data[p] = _res_conv_15_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15697,6 +17224,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free LDKUpdateFulfillHTLC _res_conv_19_conv; _res_conv_19_conv.inner = (void*)(_res_conv_19 & (~1)); _res_conv_19_conv.is_owned = (_res_conv_19 & 1) || (_res_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); _res_constr.data[t] = _res_conv_19_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15716,6 +17244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JN LDKUpdateFailHTLC _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15735,6 +17264,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ LDKUpdateFailMalformedHTLC _res_conv_25_conv; _res_conv_25_conv.inner = (void*)(_res_conv_25 & (~1)); _res_conv_25_conv.is_owned = (_res_conv_25 & 1) || (_res_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv); _res_constr.data[z] = _res_conv_25_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15745,6 +17275,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecod LDKAcceptChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AcceptChannel_clone(&o_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv); @@ -15755,12 +17286,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15770,6 +17308,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeEr CResult_AcceptChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(orig & ~1); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); @@ -15781,6 +17330,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignat LDKAnnouncementSignatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AnnouncementSignatures_clone(&o_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv); @@ -15791,12 +17341,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignat LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15806,6 +17363,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignature CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(orig & ~1); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); @@ -15817,6 +17385,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablish LDKChannelReestablish o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelReestablish_clone(&o_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); @@ -15827,12 +17396,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablish LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15842,6 +17418,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDec CResult_ChannelReestablishDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); @@ -15853,6 +17440,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecod LDKClosingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSigned_clone(&o_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv); @@ -15863,12 +17451,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15878,6 +17473,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeEr CResult_ClosingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); @@ -15889,6 +17495,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa LDKClosingSignedFeeRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSignedFeeRange_clone(&o_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv); @@ -15899,12 +17506,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15914,6 +17528,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); @@ -15925,6 +17550,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDe LDKCommitmentSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentSigned_clone(&o_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv); @@ -15935,12 +17561,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDe LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15950,6 +17583,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecod CResult_CommitmentSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); @@ -15961,6 +17605,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDeco LDKFundingCreated o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingCreated_clone(&o_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv); @@ -15971,12 +17616,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15986,6 +17638,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeE CResult_FundingCreatedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); @@ -15997,6 +17660,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod LDKFundingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingSigned_clone(&o_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); @@ -16007,12 +17671,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16022,6 +17693,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeEr CResult_FundingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); @@ -16033,6 +17715,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod LDKFundingLocked o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingLocked_clone(&o_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); @@ -16043,12 +17726,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingLockedDecodeErrorZ* o_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingLockedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16058,6 +17748,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeEr CResult_FundingLockedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); + *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); @@ -16069,6 +17770,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1 LDKInit o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Init_clone(&o_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); @@ -16079,12 +17781,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16094,6 +17803,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1fre CResult_InitDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)(orig & ~1); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); @@ -16105,6 +17825,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeE LDKOpenChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OpenChannel_clone(&o_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); @@ -16115,12 +17836,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16130,6 +17858,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErro CResult_OpenChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(orig & ~1); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); @@ -16141,6 +17880,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecode LDKRevokeAndACK o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RevokeAndACK_clone(&o_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); @@ -16151,12 +17891,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16166,6 +17913,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErr CResult_RevokeAndACKDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(orig & ~1); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); @@ -16177,6 +17935,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErro LDKShutdown o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Shutdown_clone(&o_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); @@ -16187,12 +17946,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16202,6 +17968,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_ CResult_ShutdownDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); @@ -16213,6 +17990,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDeco LDKUpdateFailHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailHTLC_clone(&o_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); @@ -16223,12 +18001,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16238,6 +18023,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeE CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); @@ -16249,6 +18045,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalforme LDKUpdateFailMalformedHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailMalformedHTLC_clone(&o_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv); @@ -16259,12 +18056,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalforme LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16274,6 +18078,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHT CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); @@ -16285,6 +18100,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErr LDKUpdateFee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFee_clone(&o_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv); @@ -16295,12 +18111,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16310,6 +18133,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); + *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); @@ -16321,6 +18155,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCD LDKUpdateFulfillHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFulfillHTLC_clone(&o_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv); @@ -16331,12 +18166,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16346,6 +18188,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDeco CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); @@ -16357,6 +18210,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecod LDKUpdateAddHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateAddHTLC_clone(&o_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv); @@ -16367,12 +18221,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16382,6 +18243,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeEr CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); @@ -16393,6 +18265,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1 LDKPing o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Ping_clone(&o_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv); @@ -16403,12 +18276,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PingDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16418,6 +18298,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1fre CResult_PingDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = CResult_PingDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)(orig & ~1); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); @@ -16429,6 +18320,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1 LDKPong o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Pong_clone(&o_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv); @@ -16439,12 +18331,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PongDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16454,6 +18353,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1fre CResult_PongDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = CResult_PongDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)(orig & ~1); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); @@ -16465,6 +18375,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnn LDKUnsignedChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelAnnouncement_clone(&o_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -16475,12 +18386,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnn LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16490,6 +18408,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnoun CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); @@ -16501,6 +18430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncemen LDKChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelAnnouncement_clone(&o_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -16511,12 +18441,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncemen LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16526,6 +18463,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDe CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); @@ -16537,6 +18485,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpd LDKUnsignedChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelUpdate_clone(&o_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv); @@ -16547,12 +18496,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpd LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16562,6 +18518,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); @@ -16573,6 +18540,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecod LDKChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelUpdate_clone(&o_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv); @@ -16583,12 +18551,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16598,6 +18573,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeEr CResult_ChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); @@ -16609,6 +18595,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecode LDKErrorMessage o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ErrorMessage_clone(&o_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv); @@ -16619,12 +18606,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16634,6 +18628,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErr CResult_ErrorMessageDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(orig & ~1); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); @@ -16645,6 +18650,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnoun LDKUnsignedNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedNodeAnnouncement_clone(&o_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -16655,12 +18661,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnoun LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16670,6 +18683,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncem CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); @@ -16681,6 +18705,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDe LDKNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncement_clone(&o_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -16691,12 +18716,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDe LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16706,6 +18738,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecod CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); @@ -16717,6 +18760,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelI LDKQueryShortChannelIds o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryShortChannelIds_clone(&o_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv); @@ -16727,12 +18771,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelI LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16742,6 +18793,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsD CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(orig & ~1); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); @@ -16753,6 +18815,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelI LDKReplyShortChannelIdsEnd o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyShortChannelIdsEnd_clone(&o_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv); @@ -16763,12 +18826,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelI LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16778,6 +18848,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsE CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); @@ -16789,6 +18870,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeD LDKQueryChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryChannelRange_clone(&o_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv); @@ -16799,12 +18881,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16814,6 +18903,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDeco CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); @@ -16825,6 +18925,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeD LDKReplyChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyChannelRange_clone(&o_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv); @@ -16835,12 +18936,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16850,6 +18958,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDeco CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); @@ -16861,6 +18980,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil LDKGossipTimestampFilter o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = GossipTimestampFilter_clone(&o_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv); @@ -16871,12 +18991,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16886,6 +19013,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(orig & ~1); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); @@ -16897,6 +19035,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv); @@ -16913,6 +19052,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16922,6 +19067,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreation CResult_InvoiceSignOrCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(orig & ~1); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); @@ -16963,6 +19119,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonit LDKLockedChannelMonitor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKLockedChannelMonitor LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); @@ -16975,6 +19132,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonit return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)(o & ~1); + jboolean ret_val = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16997,6 +19160,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv * LDKOutPoint _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -17012,6 +19176,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *e PaymentPurpose_free(this_ptr_conv); } +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)arg; + int64_t ret_val = PaymentPurpose_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig; LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); @@ -17052,6 +19228,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *en ClosureReason_free(this_ptr_conv); } +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)arg; + int64_t ret_val = ClosureReason_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosureReason* orig_conv = (LDKClosureReason*)orig; LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); @@ -17120,6 +19308,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JN return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17129,6 +19327,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclas Event_free(this_ptr_conv); } +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKEvent* arg_conv = (LDKEvent*)arg; + int64_t ret_val = Event_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKEvent* orig_conv = (LDKEvent*)orig; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); @@ -17208,6 +19418,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -17219,6 +19430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile LDKRouteParameters retry_conv; retry_conv.inner = (void*)(retry & (~1)); retry_conv.is_owned = (retry & 1) || (retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv); retry_conv = RouteParameters_clone(&retry_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv); @@ -17305,6 +19517,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *en return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17314,6 +19536,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv MessageSendEvent_free(this_ptr_conv); } +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)arg; + int64_t ret_val = MessageSendEvent_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig; LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); @@ -17329,6 +19563,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1acc LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AcceptChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); @@ -17343,6 +19578,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1ope LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = OpenChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); @@ -17357,6 +19593,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingCreated_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); @@ -17371,6 +19608,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); @@ -17385,6 +19623,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingLocked_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); @@ -17399,6 +19638,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1ann LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AnnouncementSignatures_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); @@ -17413,6 +19653,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1h LDKCommitmentUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = (updates & 1) || (updates == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); updates_conv = CommitmentUpdate_clone(&updates_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); @@ -17427,6 +19668,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1rev LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = RevokeAndACK_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); @@ -17441,6 +19683,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1clo LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ClosingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); @@ -17455,6 +19698,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shu LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = Shutdown_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); @@ -17469,6 +19713,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelReestablish_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); @@ -17480,10 +19725,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelAnnouncement_clone(&msg_conv); LDKChannelUpdate update_msg_conv; update_msg_conv.inner = (void*)(update_msg & (~1)); update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); update_msg_conv = ChannelUpdate_clone(&update_msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); @@ -17495,6 +19742,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = NodeAnnouncement_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); @@ -17506,6 +19754,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); @@ -17520,6 +19769,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); @@ -17548,6 +19798,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); @@ -17562,6 +19813,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1sho LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); @@ -17576,6 +19828,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1rep LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); @@ -17619,6 +19872,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jc APIError_free(this_ptr_conv); } +static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)arg; + int64_t ret_val = APIError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAPIError* orig_conv = (LDKAPIError*)orig; LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); @@ -17670,6 +19935,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shu LDKShutdownScript script_conv; script_conv.inner = (void*)(script & (~1)); script_conv.is_owned = (script & 1) || (script == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); script_conv = ShutdownScript_clone(&script_conv); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_incompatible_shutdown_script(script_conv); @@ -17764,6 +20030,147 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jcla return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRecord this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Record_free(this_obj_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv)); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKLevel val_conv = LDKLevel_from_java(env, val); + Record_set_level(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_args(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_args(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_module_path(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_file(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_file(&this_ptr_conv, val_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_val = Record_get_line(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Record_set_line(&this_ptr_conv, val); +} + +static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRecord arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Record_clone_ptr(&arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecord orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKRecord ret_var = Record_clone(&orig_conv); + uint64_t ret_ref = 0; + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17777,6 +20184,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(J LDKChannelHandshakeConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeConfig_free(this_obj_conv); } @@ -17784,6 +20192,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -17792,6 +20201,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1m LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } @@ -17799,6 +20209,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); return ret_val; } @@ -17807,6 +20218,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); } @@ -17814,6 +20226,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -17822,6 +20235,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } @@ -17830,6 +20244,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17837,14 +20252,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new return ret_ref; } +static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelHandshakeConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17857,6 +20295,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1def uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17868,6 +20307,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(J LDKChannelHandshakeLimits this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeLimits_free(this_obj_conv); } @@ -17875,6 +20315,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -17883,6 +20324,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); } @@ -17890,6 +20332,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -17898,6 +20341,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); } @@ -17905,6 +20349,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -17913,6 +20358,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -17920,6 +20366,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -17928,6 +20375,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -17935,6 +20383,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -17943,6 +20392,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); } @@ -17950,6 +20400,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); return ret_val; } @@ -17958,6 +20409,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); } @@ -17965,6 +20417,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1ge LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); return ret_val; } @@ -17973,6 +20426,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1f LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); } @@ -17980,6 +20434,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); return ret_val; } @@ -17988,6 +20443,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1t LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); } @@ -17996,6 +20452,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18003,14 +20460,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new return ret_ref; } +static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeLimits arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelHandshakeLimits orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18023,6 +20503,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1def uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18034,6 +20515,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *en LDKChannelConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelConfig_free(this_obj_conv); } @@ -18041,6 +20523,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forward LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -18049,6 +20532,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); } @@ -18056,6 +20540,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forward LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -18064,6 +20549,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } @@ -18071,6 +20557,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1e LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -18079,6 +20566,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expi LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -18086,6 +20574,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_announced_channel(&this_ptr_conv); return ret_val; } @@ -18094,6 +20583,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_announced_channel(&this_ptr_conv, val); } @@ -18101,6 +20591,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); return ret_val; } @@ -18109,6 +20600,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1up LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } @@ -18116,6 +20608,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1du LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); return ret_val; } @@ -18124,6 +20617,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); } @@ -18131,6 +20625,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1 LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -18139,6 +20634,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1clo LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); } @@ -18147,6 +20643,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18154,14 +20651,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * return ret_ref; } +static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18174,6 +20694,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18185,6 +20706,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JN LDKChannelConfig obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18206,6 +20728,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, LDKUserConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UserConfig_free(this_obj_conv); } @@ -18213,10 +20736,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1chann LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18228,9 +20753,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_ LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeConfig_clone(&val_conv); UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); } @@ -18239,10 +20766,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1chan LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18254,9 +20783,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeLimits_clone(&val_conv); UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); } @@ -18265,10 +20796,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1o LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18280,9 +20813,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1opti LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelConfig_clone(&val_conv); UserConfig_set_channel_options(&this_ptr_conv, val_conv); } @@ -18291,6 +20826,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1f LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); return ret_val; } @@ -18299,6 +20835,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwa LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); } @@ -18306,19 +20843,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env LDKChannelHandshakeConfig own_channel_config_arg_conv; own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); LDKChannelConfig channel_options_arg_conv; channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18326,14 +20867,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env return ret_ref; } +static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUserConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UserConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUserConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUserConfig ret_var = UserConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18346,6 +20910,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18357,17 +20922,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, j LDKBestBlock this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BestBlock_free(this_obj_conv); } +static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBestBlock arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BestBlock_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBestBlock orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBestBlock ret_var = BestBlock_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18381,6 +20970,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JN uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18396,6 +20986,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18407,6 +20998,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash( LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); return ret_arr; @@ -18416,6 +21008,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *e LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = BestBlock_height(&this_arg_conv); return ret_val; } @@ -18501,6 +21094,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *en LDKWatchedOutput this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); WatchedOutput_free(this_obj_conv); } @@ -18508,6 +21102,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1blo LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data); return ret_arr; @@ -18517,6 +21112,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1has LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -18527,10 +21123,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoin LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18542,9 +21140,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(J LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); } @@ -18553,6 +21153,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1scr LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18563,6 +21164,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pu LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -18577,6 +21179,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKCVec_u8Z script_pubkey_arg_ref; script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg); @@ -18586,6 +21189,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18593,14 +21197,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * return ret_ref; } +static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = WatchedOutput_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKWatchedOutput orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18612,6 +21239,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv LDKWatchedOutput o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = WatchedOutput_hash(&o_conv); return ret_val; } @@ -18666,17 +21294,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv * LDKMonitorUpdateId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateId_free(this_obj_conv); } +static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorUpdateId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorUpdateId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18688,6 +21340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEn LDKMonitorUpdateId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MonitorUpdateId_hash(&o_conv); return ret_val; } @@ -18696,9 +21349,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv LDKMonitorUpdateId a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMonitorUpdateId b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv); return ret_val; } @@ -18716,6 +21371,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNI LDKLockedChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockedChannelMonitor_free(this_obj_conv); } @@ -18723,6 +21379,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env LDKChainMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainMonitor_free(this_obj_conv); } @@ -18770,6 +21427,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18781,6 +21439,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1cla LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ignored_channels_constr; ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels); if (ignored_channels_constr.datalen > 0) @@ -18793,6 +21452,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1cla LDKChannelDetails ignored_channels_conv_16_conv; ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; } @@ -18816,9 +21476,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor( LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); @@ -18829,6 +21491,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -18838,6 +21501,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo uint64_t ret_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner; if (ret_conv_10_var.is_owned) { ret_conv_10_ref |= 1; @@ -18853,13 +21517,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1moni LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorUpdateId completed_update_id_conv; completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); @@ -18870,6 +21537,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JN LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -18879,6 +21547,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(J LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -18888,6 +21557,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNI LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); return (uint64_t)ret_ret; @@ -18897,6 +21567,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsPro LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -18906,6 +21577,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNI LDKChannelMonitorUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitorUpdate_free(this_obj_conv); } @@ -18913,6 +21585,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1 LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); return ret_val; } @@ -18921,17 +21594,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1upd LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } +static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitorUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelMonitorUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18943,6 +21640,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1w LDKChannelMonitorUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18964,6 +21662,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEn LDKMonitorUpdateError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateError_free(this_obj_conv); } @@ -18971,6 +21670,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1get_1a( LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -18981,6 +21681,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1set_1a(JNI LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); MonitorUpdateError_set_a(&this_ptr_conv, val_conv); } @@ -18991,6 +21692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNI uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18998,14 +21700,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNI return ret_ref; } +static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) { + LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorUpdateError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorUpdateError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19022,6 +21747,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env MonitorEvent_free(this_ptr_conv); } +static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; + int64_t ret_val = MonitorEvent_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); @@ -19034,6 +21771,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNI LDKHTLCUpdate a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = HTLCUpdate_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_htlcevent(a_conv); @@ -19045,6 +21783,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1t LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); @@ -19056,6 +21795,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1compl LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); @@ -19067,6 +21807,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1faile LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_failed(a_conv); @@ -19083,21 +21824,55 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNI return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKHTLCUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCUpdate_free(this_obj_conv); } +static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHTLCUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19109,6 +21884,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEn LDKHTLCUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19135,6 +21911,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jcl Balance_free(this_ptr_conv); } +static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBalance* arg_conv = (LDKBalance*)arg; + int64_t ret_val = Balance_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBalance* orig_conv = (LDKBalance*)orig; LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); @@ -19182,17 +21970,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *e LDKChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitor_free(this_obj_conv); } +static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelMonitor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19204,6 +22016,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(J LDKChannelMonitor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19215,9 +22028,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1mon LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMonitorUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; @@ -19236,6 +22051,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ChannelMonitor_get_latest_update_id(&this_arg_conv); return ret_val; } @@ -19244,6 +22060,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1fundin LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); return ((uint64_t)ret_conv); @@ -19253,6 +22070,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1o LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19271,6 +22089,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* filter_ptr = (void*)(((uint64_t)filter) & ~1); if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } LDKFilter* filter_conv = (LDKFilter*)filter_ptr; @@ -19281,6 +22100,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19300,6 +22120,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19319,6 +22140,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1l LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; @@ -19342,6 +22164,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19401,6 +22224,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconn LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19433,6 +22257,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transa LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19492,6 +22317,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1u LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char txid_arr[32]; CHECK((*env)->GetArrayLength(env, txid) == 32); (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); @@ -19524,6 +22350,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1 LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19567,6 +22394,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1r LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); @@ -19585,10 +22413,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1be LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19600,6 +22430,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1c LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19632,6 +22463,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jc LDKOutPoint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OutPoint_free(this_obj_conv); } @@ -19639,6 +22471,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNI LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv)); return ret_arr; @@ -19648,6 +22481,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *en LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -19658,6 +22492,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OutPoint_get_index(&this_ptr_conv); return ret_val; } @@ -19666,6 +22501,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *e LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OutPoint_set_index(&this_ptr_conv, val); } @@ -19677,6 +22513,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19684,14 +22521,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOutPoint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OutPoint_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKOutPoint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOutPoint ret_var = OutPoint_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19703,9 +22563,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKOutPoint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = OutPoint_eq(&a_conv, &b_conv); return ret_val; } @@ -19714,6 +22576,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = OutPoint_hash(&o_conv); return ret_val; } @@ -19722,6 +22585,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1 LDKOutPoint this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data); return ret_arr; @@ -19731,6 +22595,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv LDKOutPoint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19752,6 +22617,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DelayedPaymentOutputDescriptor_free(this_obj_conv); } @@ -19759,10 +22625,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19774,9 +22642,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -19785,6 +22655,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -19794,6 +22665,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -19804,6 +22676,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -19812,6 +22685,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } @@ -19819,6 +22693,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -19830,6 +22705,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -19839,6 +22715,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -19849,6 +22726,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); return ret_arr; @@ -19858,6 +22736,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -19868,6 +22747,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -19876,6 +22756,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -19883,6 +22764,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKPublicKey per_commitment_point_arg_ref; CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); @@ -19901,6 +22783,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19908,14 +22791,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip return ret_ref; } +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19927,6 +22833,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19948,6 +22855,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); StaticPaymentOutputDescriptor_free(this_obj_conv); } @@ -19955,10 +22863,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19970,9 +22880,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -19981,6 +22893,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -19992,6 +22905,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDesc LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); return ret_arr; @@ -20001,6 +22915,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -20011,6 +22926,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -20019,6 +22935,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -20026,6 +22943,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); @@ -20038,6 +22956,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20045,14 +22964,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript return ret_ref; } +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20064,6 +23006,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDesc LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -20090,6 +23033,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1fre SpendableOutputDescriptor_free(this_ptr_conv); } +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; + int64_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); @@ -20102,6 +23057,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKOutPoint outpoint_conv; outpoint_conv.inner = (void*)(outpoint & (~1)); outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); outpoint_conv = OutPoint_clone(&outpoint_conv); void* output_ptr = (void*)(((uint64_t)output) & ~1); CHECK_ACCESS(output_ptr); @@ -20117,6 +23073,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); @@ -20128,6 +23085,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); @@ -20163,6 +23121,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jc BaseSign_free(this_ptr_conv); } +static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSign* arg_conv = (LDKSign*)arg_ptr; + int64_t ret_val = Sign_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -20194,6 +23165,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *e LDKInMemorySigner this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InMemorySigner_free(this_obj_conv); } @@ -20201,6 +23173,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1fu LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); return ret_arr; @@ -20210,6 +23183,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20220,6 +23194,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1re LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); return ret_arr; @@ -20229,6 +23204,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocatio LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20239,6 +23215,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1pa LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); return ret_arr; @@ -20248,6 +23225,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20258,6 +23236,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1de LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); return ret_arr; @@ -20267,6 +23246,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20277,6 +23257,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1ht LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); return ret_arr; @@ -20286,6 +23267,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1bas LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20296,6 +23278,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1co LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); return ret_arr; @@ -20305,20 +23288,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitmen LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInMemorySigner arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InMemorySigner_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInMemorySigner orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20352,6 +23359,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20363,10 +23371,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20378,6 +23388,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -20386,6 +23397,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1sel LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -20394,6 +23406,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbou LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InMemorySigner_is_outbound(&this_arg_conv); return ret_val; } @@ -20402,10 +23415,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1ou LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20417,10 +23432,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channe LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20432,6 +23449,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1count LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -20440,6 +23458,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1count LDKStaticPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -20449,6 +23468,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynam LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -20457,6 +23477,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynam LDKDelayedPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -20466,6 +23487,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSig LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); return (uint64_t)ret_ret; @@ -20475,6 +23497,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JN LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); return (uint64_t)ret_ret; @@ -20484,6 +23507,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(J LDKInMemorySigner obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -20505,6 +23529,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, LDKKeysManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); KeysManager_free(this_obj_conv); } @@ -20517,6 +23542,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *en uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20528,6 +23554,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channe LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char params_arr[32]; CHECK((*env)->GetArrayLength(env, params) == 32); (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); @@ -20536,6 +23563,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channe uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20547,6 +23575,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendab LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_SpendableOutputDescriptorZ descriptors_constr; descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); if (descriptors_constr.datalen > 0) @@ -20592,6 +23621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterf LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); return (uint64_t)ret_ret; @@ -20601,6 +23631,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *e LDKChannelManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManager_free(this_obj_conv); } @@ -20608,6 +23639,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv * LDKChainParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainParameters_free(this_obj_conv); } @@ -20615,6 +23647,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1networ LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv)); return ret_conv; } @@ -20623,6 +23656,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network( LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNetwork val_conv = LDKNetwork_from_java(env, val); ChainParameters_set_network(&this_ptr_conv, val_conv); } @@ -20631,10 +23665,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_ LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20646,9 +23682,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1bl LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = BestBlock_clone(&val_conv); ChainParameters_set_best_block(&this_ptr_conv, val_conv); } @@ -20658,11 +23696,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv LDKBestBlock best_block_arg_conv; best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20670,14 +23710,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv return ret_ref; } +static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChainParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChainParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChainParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20689,6 +23752,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1fr LDKCounterpartyForwardingInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyForwardingInfo_free(this_obj_conv); } @@ -20696,6 +23760,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -20704,6 +23769,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); } @@ -20711,6 +23777,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -20719,6 +23786,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); } @@ -20726,6 +23794,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -20734,6 +23803,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -20742,6 +23812,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20749,14 +23820,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ return ret_ref; } +static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyForwardingInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCounterpartyForwardingInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20768,6 +23862,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIE LDKChannelCounterparty this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelCounterparty_free(this_obj_conv); } @@ -20775,6 +23870,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1ge LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -20784,6 +23880,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -20794,10 +23891,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1f LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20809,9 +23908,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1feat LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); ChannelCounterparty_set_features(&this_ptr_conv, val_conv); } @@ -20820,6 +23921,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1u LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); return ret_val; } @@ -20828,6 +23930,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unsp LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } @@ -20835,11 +23938,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1f LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20852,9 +23957,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forw LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyForwardingInfo_clone(&val_conv); ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } @@ -20866,15 +23973,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JN LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKCounterpartyForwardingInfo forwarding_info_arg_conv; forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20882,14 +23992,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JN return ret_ref; } +static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelCounterparty arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelCounterparty orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20901,6 +24034,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *e LDKChannelDetails this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelDetails_free(this_obj_conv); } @@ -20908,6 +24042,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1ch LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -20917,6 +24052,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -20927,10 +24063,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counte LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20942,9 +24080,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterpa LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelCounterparty_clone(&val_conv); ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } @@ -20953,11 +24093,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1fundin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20970,9 +24112,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } @@ -20981,6 +24125,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -20991,6 +24136,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1ch LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -21002,6 +24148,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channe LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -21010,6 +24157,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -21017,6 +24165,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspen LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21027,6 +24176,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendab LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -21038,6 +24188,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_user_channel_id(&this_ptr_conv); return ret_val; } @@ -21046,6 +24197,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1cha LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_user_channel_id(&this_ptr_conv, val); } @@ -21053,6 +24205,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbou LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -21061,6 +24214,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } @@ -21068,6 +24222,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inboun LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -21076,6 +24231,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } @@ -21083,6 +24239,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confir LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21093,6 +24250,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmat LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -21104,6 +24262,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21114,6 +24273,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1cl LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); @@ -21125,6 +24285,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1o LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_outbound(&this_ptr_conv); return ret_val; } @@ -21133,6 +24294,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbo LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_outbound(&this_ptr_conv, val); } @@ -21140,6 +24302,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1f LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_funding_locked(&this_ptr_conv); return ret_val; } @@ -21148,6 +24311,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1fundi LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_funding_locked(&this_ptr_conv, val); } @@ -21155,6 +24319,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1u LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_usable(&this_ptr_conv); return ret_val; } @@ -21163,6 +24328,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usabl LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_usable(&this_ptr_conv, val); } @@ -21170,6 +24336,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1p LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_public(&this_ptr_conv); return ret_val; } @@ -21178,6 +24345,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1publi LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_public(&this_ptr_conv, val); } @@ -21188,10 +24356,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv LDKChannelCounterparty counterparty_arg_conv; counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); LDKOutPoint funding_txo_arg_conv; funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1); CHECK_ACCESS(short_channel_id_arg_ptr); @@ -21212,6 +24382,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21219,14 +24390,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv return ret_ref; } +static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelDetails arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelDetails_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelDetails orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21243,6 +24437,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEn PaymentSendFailure_free(this_ptr_conv); } +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; + int64_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); @@ -21327,6 +24533,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial LDKRouteParameters failed_paths_retry_conv; failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); @@ -21376,15 +24583,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv LDKUserConfig config_conv; config_conv.inner = (void*)(config & (~1)); config_conv.is_owned = (config & 1) || (config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); config_conv = UserConfig_clone(&config_conv); LDKChainParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21396,10 +24606,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1curren LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21411,12 +24623,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1cha LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_network_key_ref; CHECK((*env)->GetArrayLength(env, their_network_key) == 33); (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form); LDKUserConfig override_config_conv; override_config_conv.inner = (void*)(override_config & (~1)); override_config_conv.is_owned = (override_config & 1) || (override_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); override_config_conv = UserConfig_clone(&override_config_conv); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); @@ -21427,6 +24641,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -21436,6 +24651,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -21451,6 +24667,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -21460,6 +24677,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -21475,6 +24693,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21488,6 +24707,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21501,6 +24721,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1clos LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21514,6 +24735,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_force_close_all_channels(&this_arg_conv); } @@ -21521,9 +24743,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -21539,9 +24763,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1paym LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); @@ -21554,9 +24780,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spont LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); @@ -21569,6 +24797,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tr LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char temporary_channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); @@ -21587,6 +24816,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1nod LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThreeBytes rgb_ref; CHECK((*env)->GetArrayLength(env, rgb) == 3); (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data); @@ -21615,6 +24845,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pendi LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } @@ -21622,6 +24853,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1o LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_timer_tick_occurred(&this_arg_conv); } @@ -21629,6 +24861,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); @@ -21641,6 +24874,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1fun LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); @@ -21652,6 +24886,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1ou LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form); return ret_arr; @@ -21661,6 +24896,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inb LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); @@ -21674,6 +24910,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inb LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -21690,6 +24927,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Message LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -21699,6 +24937,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsP LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -21708,6 +24947,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen( LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChannelManager_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -21717,6 +24957,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -21726,6 +24967,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1per LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); return ret_val; } @@ -21734,6 +24976,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persist LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_await_persistable_update(&this_arg_conv); } @@ -21741,10 +24984,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1be LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21756,6 +25001,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Channel LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -21765,6 +25011,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(J LDKChannelManager obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -21776,6 +25023,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(J LDKChannelManagerReadArgs this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManagerReadArgs_free(this_obj_conv); } @@ -21783,6 +25031,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; return ret_ret; @@ -21792,6 +25041,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1k LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); @@ -21806,6 +25056,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; return ret_ret; @@ -21815,6 +25066,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1f LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); @@ -21829,6 +25081,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; return ret_ret; @@ -21838,6 +25091,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1c LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKWatch val_conv = *(LDKWatch*)(val_ptr); @@ -21852,6 +25106,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; return ret_ret; @@ -21861,6 +25116,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1t LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); @@ -21875,6 +25131,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; return ret_ret; @@ -21884,6 +25141,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1l LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKLogger val_conv = *(LDKLogger*)(val_ptr); @@ -21898,10 +25156,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21913,9 +25173,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1d LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UserConfig_clone(&val_conv); ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } @@ -21959,6 +25221,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new LDKUserConfig default_config_conv; default_config_conv.inner = (void*)(default_config & (~1)); default_config_conv.is_owned = (default_config & 1) || (default_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); default_config_conv = UserConfig_clone(&default_config_conv); LDKCVec_ChannelMonitorZ channel_monitors_constr; channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors); @@ -21972,6 +25235,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new LDKChannelMonitor channel_monitors_conv_16_conv; channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); @@ -21979,6 +25243,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21993,6 +25258,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa LDKChannelManagerReadArgs arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = (arg & 1) || (arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); // Warning: we need a move here but no clone is available for LDKChannelManagerReadArgs LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); @@ -22004,17 +25270,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, LDKDecodeError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DecodeError_free(this_obj_conv); } +static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { + LDKDecodeError ret_var = DecodeError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDecodeError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DecodeError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDecodeError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDecodeError ret_var = DecodeError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22026,6 +25316,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass LDKInit this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Init_free(this_obj_conv); } @@ -22033,10 +25324,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22048,9 +25341,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *en LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); Init_set_features(&this_ptr_conv, val_conv); } @@ -22059,11 +25354,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKInit ret_var = Init_new(features_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22071,14 +25368,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { + LDKInit ret_var = Init_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInit arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Init_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInit orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInit ret_var = Init_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22090,6 +25410,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env LDKErrorMessage this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErrorMessage_free(this_obj_conv); } @@ -22097,6 +25418,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1chan LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -22106,6 +25428,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22116,6 +25439,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNI LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -22126,6 +25450,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); ErrorMessage_set_data(&this_ptr_conv, val_conv); } @@ -22139,6 +25464,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22146,14 +25472,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e return ret_ref; } +static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorMessage arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ErrorMessage_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKErrorMessage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22165,6 +25514,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass LDKPing this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Ping_free(this_obj_conv); } @@ -22172,6 +25522,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_ponglen(&this_ptr_conv); return ret_val; } @@ -22180,6 +25531,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_ponglen(&this_ptr_conv, val); } @@ -22187,6 +25539,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_byteslen(&this_ptr_conv); return ret_val; } @@ -22195,6 +25548,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *en LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_byteslen(&this_ptr_conv, val); } @@ -22203,6 +25557,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22210,14 +25565,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPing arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Ping_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPing orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPing ret_var = Ping_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22229,6 +25607,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass LDKPong this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Pong_free(this_obj_conv); } @@ -22236,6 +25615,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Pong_get_byteslen(&this_ptr_conv); return ret_val; } @@ -22244,6 +25624,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *en LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Pong_set_byteslen(&this_ptr_conv, val); } @@ -22252,6 +25633,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22259,14 +25641,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPong arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Pong_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPong orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPong ret_var = Pong_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22278,6 +25683,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, LDKOpenChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OpenChannel_free(this_obj_conv); } @@ -22285,6 +25691,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -22294,6 +25701,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash( LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22304,6 +25712,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1tempo LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22313,6 +25722,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1c LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22323,6 +25733,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -22331,6 +25742,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1sat LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_funding_satoshis(&this_ptr_conv, val); } @@ -22338,6 +25750,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msa LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_push_msat(&this_ptr_conv); return ret_val; } @@ -22346,6 +25759,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(J LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_push_msat(&this_ptr_conv, val); } @@ -22353,6 +25767,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1lim LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -22361,6 +25776,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -22368,6 +25784,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -22376,6 +25793,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1v LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -22383,6 +25801,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -22391,6 +25810,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1res LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -22398,6 +25818,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1min LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -22406,6 +25827,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimu LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -22413,6 +25835,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = OpenChannel_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -22421,6 +25844,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } @@ -22428,6 +25852,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -22436,6 +25861,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1de LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -22443,6 +25869,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1acce LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -22451,6 +25878,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepte LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -22458,6 +25886,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1fundi LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -22467,6 +25896,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pub LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22477,6 +25907,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revoc LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22486,6 +25917,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22496,6 +25928,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payme LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22505,6 +25938,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1poi LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22515,6 +25949,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delay LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22524,6 +25959,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1pay LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22534,6 +25970,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22543,6 +25980,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepo LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22553,6 +25991,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22562,6 +26001,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22572,6 +26012,7 @@ JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1f LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = OpenChannel_get_channel_flags(&this_ptr_conv); return ret_val; } @@ -22580,17 +26021,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1fla LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_flags(&this_ptr_conv, val); } +static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOpenChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OpenChannel_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKOpenChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22602,6 +26067,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *en LDKAcceptChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AcceptChannel_free(this_obj_conv); } @@ -22609,6 +26075,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1tem LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22618,6 +26085,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_ LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22628,6 +26096,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1l LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -22636,6 +26105,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limi LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -22643,6 +26113,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1ht LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -22651,6 +26122,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_ LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -22658,6 +26130,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -22666,6 +26139,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1r LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -22673,6 +26147,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1m LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -22681,6 +26156,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1mini LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -22688,6 +26164,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = AcceptChannel_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -22696,6 +26173,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1d LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } @@ -22703,6 +26181,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1sel LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -22711,6 +26190,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1 LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -22718,6 +26198,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1ac LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -22726,6 +26207,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accep LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -22733,6 +26215,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fun LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -22742,6 +26225,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22752,6 +26236,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1rev LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22761,6 +26246,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22771,6 +26257,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1pay LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22780,6 +26267,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22790,6 +26278,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1del LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22799,6 +26288,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22809,6 +26299,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htl LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22818,6 +26309,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1base LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22828,6 +26320,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fir LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22837,20 +26330,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } +static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { + LDKAcceptChannel ret_var = AcceptChannel_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAcceptChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AcceptChannel_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAcceptChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22862,6 +26379,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *e LDKFundingCreated this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingCreated_free(this_obj_conv); } @@ -22869,6 +26387,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1te LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22878,6 +26397,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22888,6 +26408,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fu LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv)); return ret_arr; @@ -22897,6 +26418,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1 LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22907,6 +26429,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fundin LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); return ret_val; } @@ -22915,6 +26438,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1 LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); FundingCreated_set_funding_output_index(&this_ptr_conv, val); } @@ -22922,6 +26446,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1si LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -22931,6 +26456,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -22951,6 +26477,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22958,14 +26485,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv return ret_ref; } +static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { + LDKFundingCreated ret_var = FundingCreated_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingCreated arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingCreated_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingCreated orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22977,6 +26527,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *en LDKFundingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingSigned_free(this_obj_conv); } @@ -22984,6 +26535,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1cha LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -22993,6 +26545,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1i LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23003,6 +26556,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1sig LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23012,6 +26566,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature( LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23029,6 +26584,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23036,14 +26592,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * return ret_ref; } +static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { + LDKFundingSigned ret_var = FundingSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23055,6 +26634,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv *en LDKFundingLocked this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingLocked_free(this_obj_conv); } @@ -23062,6 +26642,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1cha LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingLocked_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23071,6 +26652,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1i LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23081,6 +26663,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1nex LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -23090,6 +26673,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_ LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -23107,6 +26691,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23114,14 +26699,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * return ret_ref; } +static inline uint64_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { + LDKFundingLocked ret_var = FundingLocked_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingLocked arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingLocked_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingLocked orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23133,6 +26741,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jc LDKShutdown this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Shutdown_free(this_obj_conv); } @@ -23140,6 +26749,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_ LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23149,6 +26759,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNI LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23159,6 +26770,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpu LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -23169,6 +26781,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JN LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -23188,6 +26801,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23195,14 +26809,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { + LDKShutdown ret_var = Shutdown_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdown arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Shutdown_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKShutdown orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdown ret_var = Shutdown_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23214,6 +26851,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JN LDKClosingSignedFeeRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSignedFeeRange_free(this_obj_conv); } @@ -23221,6 +26859,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_ LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23229,6 +26868,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1mi LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); } @@ -23236,6 +26876,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_ LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23244,6 +26885,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1ma LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); } @@ -23252,6 +26894,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23259,14 +26902,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new( return ret_ref; } +static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSignedFeeRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosingSignedFeeRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23278,6 +26944,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *en LDKClosingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSigned_free(this_obj_conv); } @@ -23285,6 +26952,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1cha LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23294,6 +26962,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1i LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23304,6 +26973,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1sa LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSigned_get_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23312,6 +26982,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satos LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); } @@ -23319,6 +26990,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1sig LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23328,6 +27000,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature( LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23338,11 +27011,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1ra LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23355,9 +27030,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ClosingSignedFeeRange_clone(&val_conv); ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } @@ -23372,11 +27049,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * LDKClosingSignedFeeRange fee_range_arg_conv; fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23384,14 +27063,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * return ret_ref; } +static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { + LDKClosingSigned ret_var = ClosingSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23403,6 +27105,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *en LDKUpdateAddHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateAddHTLC_free(this_obj_conv); } @@ -23410,6 +27113,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cha LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23419,6 +27123,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1i LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23429,6 +27134,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1i LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23437,6 +27143,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(J LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23444,6 +27151,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_ LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -23452,6 +27160,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1ms LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); } @@ -23459,6 +27168,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1pay LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv)); return ret_arr; @@ -23468,6 +27178,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1h LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23478,6 +27189,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1e LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -23486,17 +27198,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expi LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); } +static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateAddHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateAddHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23508,6 +27244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv LDKUpdateFulfillHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFulfillHTLC_free(this_obj_conv); } @@ -23515,6 +27252,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_ LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23524,6 +27262,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channe LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23534,6 +27273,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htl LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23542,6 +27282,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1 LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23549,6 +27290,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_ LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv)); return ret_arr; @@ -23558,6 +27300,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1paymen LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23575,6 +27318,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23582,14 +27326,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE return ret_ref; } +static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFulfillHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFulfillHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23601,6 +27368,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *e LDKUpdateFailHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailHTLC_free(this_obj_conv); } @@ -23608,6 +27376,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1ch LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23617,6 +27386,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1 LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23627,6 +27397,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1 LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23635,17 +27406,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id( LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); } +static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFailHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23657,6 +27452,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free( LDKUpdateFailMalformedHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailMalformedHTLC_free(this_obj_conv); } @@ -23664,6 +27460,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23673,6 +27470,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23683,6 +27481,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1ge LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23691,6 +27490,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23698,6 +27498,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1ge LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); return ret_val; } @@ -23706,17 +27507,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); } +static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailMalformedHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFailMalformedHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23728,6 +27553,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentSigned_free(this_obj_conv); } @@ -23735,6 +27561,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1 LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23744,6 +27571,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23754,6 +27582,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1 LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23763,6 +27592,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signatu LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23773,6 +27603,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1s LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -23813,6 +27644,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23820,14 +27652,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn return ret_ref; } +static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { + LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23839,6 +27694,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env LDKRevokeAndACK this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RevokeAndACK_free(this_obj_conv); } @@ -23846,6 +27702,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1chan LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23855,6 +27712,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23865,6 +27723,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_ LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv)); return ret_arr; @@ -23874,6 +27733,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commit LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23884,6 +27744,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -23893,6 +27754,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1 LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -23913,6 +27775,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23920,14 +27783,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *e return ret_ref; } +static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { + LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRevokeAndACK arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRevokeAndACK orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23939,6 +27825,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, j LDKUpdateFee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFee_free(this_obj_conv); } @@ -23946,6 +27833,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23955,6 +27843,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JN LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23965,6 +27854,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1pe LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateFee_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -23973,6 +27863,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1 LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } @@ -23984,6 +27875,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23991,14 +27883,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { + LDKUpdateFee ret_var = UpdateFee_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFee_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24010,6 +27925,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * LDKDataLossProtect this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DataLossProtect_free(this_obj_conv); } @@ -24017,6 +27933,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1y LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv)); return ret_arr; @@ -24026,6 +27943,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1la LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24036,6 +27954,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1m LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -24045,6 +27964,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1curr LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24062,6 +27982,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24069,14 +27990,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv return ret_ref; } +static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { + LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDataLossProtect arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DataLossProtect_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDataLossProtect orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24088,6 +28032,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEn LDKChannelReestablish this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelReestablish_free(this_obj_conv); } @@ -24095,6 +28040,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -24104,6 +28050,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1chann LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24114,6 +28061,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1ne LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); return ret_val; } @@ -24122,6 +28070,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_ LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); } @@ -24129,6 +28078,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1ne LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); return ret_val; } @@ -24137,17 +28087,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_ LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); } +static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { + LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelReestablish arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelReestablish orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24159,6 +28133,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(J LDKAnnouncementSignatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AnnouncementSignatures_free(this_obj_conv); } @@ -24166,6 +28141,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -24175,6 +28151,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1c LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24185,6 +28162,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24193,6 +28171,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1s LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); } @@ -24200,6 +28179,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24209,6 +28189,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1n LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24219,6 +28200,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24228,6 +28210,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1b LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24248,6 +28231,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24255,14 +28239,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new return ret_ref; } +static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAnnouncementSignatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAnnouncementSignatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24279,6 +28286,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, NetAddress_free(this_ptr_conv); } +static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetAddress* arg_conv = (LDKNetAddress*)arg; + int64_t ret_val = NetAddress_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetAddress* orig_conv = (LDKNetAddress*)orig; LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); @@ -24350,6 +28369,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free LDKUnsignedNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedNodeAnnouncement_free(this_obj_conv); } @@ -24357,10 +28377,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1g LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24372,9 +28394,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -24383,6 +28407,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1g LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); return ret_val; } @@ -24391,6 +28416,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); } @@ -24398,6 +28424,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -24407,6 +28434,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24417,6 +28445,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 3); (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv)); return ret_arr; @@ -24426,6 +28455,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 3); (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); @@ -24436,6 +28466,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv)); return ret_arr; @@ -24445,6 +28476,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24455,6 +28487,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -24474,14 +28507,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24493,6 +28549,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv LDKNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncement_free(this_obj_conv); } @@ -24500,6 +28557,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1 LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24509,6 +28567,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signatu LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24519,10 +28578,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1cont LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24534,9 +28595,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1content LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedNodeAnnouncement_clone(&val_conv); NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -24548,11 +28611,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn LDKUnsignedNodeAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24560,14 +28625,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn return ret_ref; } +static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24579,6 +28667,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1f LDKUnsignedChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelAnnouncement_free(this_obj_conv); } @@ -24586,10 +28675,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24601,9 +28692,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -24612,6 +28705,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -24621,6 +28715,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24631,6 +28726,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24639,6 +28735,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); } @@ -24646,6 +28743,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form); return ret_arr; @@ -24655,6 +28753,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24665,6 +28764,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form); return ret_arr; @@ -24674,6 +28774,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24684,6 +28785,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form); return ret_arr; @@ -24693,6 +28795,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24703,6 +28806,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form); return ret_arr; @@ -24712,20 +28816,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } +static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24737,6 +28865,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIE LDKChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelAnnouncement_free(this_obj_conv); } @@ -24744,6 +28873,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form); return ret_arr; @@ -24753,6 +28883,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24763,6 +28894,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form); return ret_arr; @@ -24772,6 +28904,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24782,6 +28915,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form); return ret_arr; @@ -24791,6 +28925,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24801,6 +28936,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form); return ret_arr; @@ -24810,6 +28946,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24820,10 +28957,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1c LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24835,9 +28974,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1cont LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelAnnouncement_clone(&val_conv); ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -24858,11 +28999,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN LDKUnsignedChannelAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24870,14 +29013,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN return ret_ref; } +static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24889,6 +29055,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JN LDKUnsignedChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelUpdate_free(this_obj_conv); } @@ -24896,6 +29063,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1 LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -24905,6 +29073,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ch LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24915,6 +29084,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24923,6 +29093,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1sh LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); } @@ -24930,6 +29101,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); return ret_val; } @@ -24938,6 +29110,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ti LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } @@ -24945,6 +29118,7 @@ JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1 LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = UnsignedChannelUpdate_get_flags(&this_ptr_conv); return ret_val; } @@ -24953,6 +29127,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fl LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } @@ -24960,6 +29135,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -24968,6 +29144,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cl LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -24975,6 +29152,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -24983,6 +29161,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ht LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -24990,6 +29169,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -24998,6 +29178,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fe LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); } @@ -25005,6 +29186,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -25013,17 +29195,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fe LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); } +static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25035,6 +29241,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *en LDKChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelUpdate_free(this_obj_conv); } @@ -25042,6 +29249,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1sig LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -25051,6 +29259,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature( LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -25061,10 +29270,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1content LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25076,9 +29287,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(J LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelUpdate_clone(&val_conv); ChannelUpdate_set_contents(&this_ptr_conv, val_conv); } @@ -25090,11 +29303,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * LDKUnsignedChannelUpdate contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25102,14 +29317,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * return ret_ref; } +static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { + LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25121,6 +29359,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv LDKQueryChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryChannelRange_free(this_obj_conv); } @@ -25128,6 +29367,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25137,6 +29377,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25147,6 +29388,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1fir LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -25155,6 +29397,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -25162,6 +29405,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1num LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -25170,6 +29414,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -25181,6 +29426,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25188,14 +29434,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIE return ret_ref; } +static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { + LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKQueryChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25207,6 +29476,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv LDKReplyChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyChannelRange_free(this_obj_conv); } @@ -25214,6 +29484,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25223,6 +29494,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25233,6 +29505,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1fir LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -25241,6 +29514,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -25248,6 +29522,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1num LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -25256,6 +29531,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -25263,6 +29539,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sy LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyChannelRange_get_sync_complete(&this_ptr_conv); return ret_val; } @@ -25271,6 +29548,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1 LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); } @@ -25278,6 +29556,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25313,6 +29592,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25320,14 +29600,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIE return ret_ref; } +static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKReplyChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25339,6 +29642,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNI LDKQueryShortChannelIds this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryShortChannelIds_free(this_obj_conv); } @@ -25346,6 +29650,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1g LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25355,6 +29660,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1cha LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25365,6 +29671,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1sho LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25400,6 +29707,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(J uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25407,14 +29715,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(J return ret_ref; } +static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryShortChannelIds arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKQueryShortChannelIds orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25426,6 +29757,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free( LDKReplyShortChannelIdsEnd this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyShortChannelIdsEnd_free(this_obj_conv); } @@ -25433,6 +29765,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25442,6 +29775,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1 LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25452,6 +29786,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1g LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); return ret_val; } @@ -25460,6 +29795,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1 LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); } @@ -25471,6 +29807,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1ne uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25478,14 +29815,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1ne return ret_ref; } +static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyShortChannelIdsEnd arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKReplyShortChannelIdsEnd orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25497,6 +29857,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JN LDKGossipTimestampFilter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); GossipTimestampFilter_free(this_obj_conv); } @@ -25504,6 +29865,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1 LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25513,6 +29875,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ch LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25523,6 +29886,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); return ret_val; } @@ -25531,6 +29895,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1fi LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); } @@ -25538,6 +29903,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); return ret_val; } @@ -25546,6 +29912,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ti LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); } @@ -25557,6 +29924,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25564,14 +29932,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new( return ret_ref; } +static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKGossipTimestampFilter arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKGossipTimestampFilter orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25588,6 +29979,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, ErrorAction_free(this_ptr_conv); } +static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorAction* arg_conv = (LDKErrorAction*)arg; + int64_t ret_val = ErrorAction_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKErrorAction* orig_conv = (LDKErrorAction*)orig; LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); @@ -25600,6 +30003,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1pe LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_disconnect_peer(msg_conv); @@ -25626,6 +30030,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1m LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_send_error_message(msg_conv); @@ -25637,6 +30042,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *e LDKLightningError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LightningError_free(this_obj_conv); } @@ -25644,6 +30050,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JN LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = LightningError_get_err(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -25654,6 +30061,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEn LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); LightningError_set_err(&this_ptr_conv, val_conv); } @@ -25662,6 +30070,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = LightningError_get_action(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -25672,6 +30081,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JN LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); @@ -25689,6 +30099,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25696,14 +30107,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv return ret_ref; } +static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { + LDKLightningError ret_var = LightningError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKLightningError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = LightningError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKLightningError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKLightningError ret_var = LightningError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25715,6 +30149,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv LDKCommitmentUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentUpdate_free(this_obj_conv); } @@ -25722,6 +30157,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25731,6 +30167,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_15_ref = 0; CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner; if (ret_conv_15_var.is_owned) { ret_conv_15_ref |= 1; @@ -25746,6 +30183,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25758,6 +30196,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateAddHTLC val_conv_15_conv; val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); val_constr.data[p] = val_conv_15_conv; } @@ -25769,6 +30208,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25778,6 +30218,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_19_ref = 0; CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner; if (ret_conv_19_var.is_owned) { ret_conv_19_ref |= 1; @@ -25793,6 +30234,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25805,6 +30247,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFulfillHTLC val_conv_19_conv; val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); val_constr.data[t] = val_conv_19_conv; } @@ -25816,6 +30259,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25825,6 +30269,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -25840,6 +30285,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25852,6 +30298,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFailHTLC val_conv_16_conv; val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); val_constr.data[q] = val_conv_16_conv; } @@ -25863,6 +30310,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25872,6 +30320,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_25_ref = 0; CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner; if (ret_conv_25_var.is_owned) { ret_conv_25_ref |= 1; @@ -25887,6 +30336,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25899,6 +30349,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFailMalformedHTLC val_conv_25_conv; val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); val_constr.data[z] = val_conv_25_conv; } @@ -25910,11 +30361,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1upda LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25927,9 +30380,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UpdateFee_clone(&val_conv); CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); } @@ -25938,10 +30393,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1comm LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25953,9 +30410,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitm LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CommitmentSigned_clone(&val_conv); CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); } @@ -25973,6 +30432,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; } @@ -25989,6 +30449,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; } @@ -26005,6 +30466,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; } @@ -26021,6 +30483,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; } @@ -26028,15 +30491,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFee update_fee_arg_conv; update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); LDKCommitmentSigned commitment_signed_arg_conv; commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26044,14 +30510,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn return ret_ref; } +static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26081,6 +30570,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JN LDKAcceptChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26102,6 +30592,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26123,6 +30614,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1wri LDKChannelReestablish obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26144,6 +30636,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JN LDKClosingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26165,6 +30658,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1 LDKClosingSignedFeeRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26186,6 +30680,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write LDKCommitmentSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26207,6 +30702,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(J LDKFundingCreated obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26228,6 +30724,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JN LDKFundingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26249,6 +30746,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JN LDKFundingLocked obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26270,6 +30768,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env LDKInit obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Init_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26291,6 +30790,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIE LDKOpenChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26312,6 +30812,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNI LDKRevokeAndACK obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26333,6 +30834,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv LDKShutdown obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26354,6 +30856,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(J LDKUpdateFailHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26375,6 +30878,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC LDKUpdateFailMalformedHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26396,6 +30900,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv LDKUpdateFee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26417,6 +30922,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1writ LDKUpdateFulfillHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26438,6 +30944,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JN LDKUpdateAddHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26459,6 +30966,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env LDKPing obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Ping_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26480,6 +30988,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env LDKPong obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Pong_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26501,6 +31010,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26522,6 +31032,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1wr LDKChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26543,6 +31054,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1 LDKUnsignedChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26564,6 +31076,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JN LDKChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26585,6 +31098,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNI LDKErrorMessage obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26606,6 +31120,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26627,6 +31142,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write LDKNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26658,6 +31174,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1w LDKQueryShortChannelIds obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26669,6 +31186,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd LDKReplyShortChannelIdsEnd obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26690,6 +31208,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blo LDKQueryChannelRange this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv); return ret_val; } @@ -26698,6 +31217,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1writ LDKQueryChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26729,6 +31249,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1writ LDKReplyChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26740,6 +31261,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1 LDKGossipTimestampFilter obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26770,6 +31292,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(J LDKIgnoringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); IgnoringMessageHandler_free(this_obj_conv); } @@ -26778,6 +31301,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26789,6 +31313,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -26798,6 +31323,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26807,6 +31333,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); return (uint64_t)ret_ret; @@ -26816,6 +31343,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26825,6 +31353,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(J LDKErroringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErroringMessageHandler_free(this_obj_conv); } @@ -26833,6 +31362,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26844,6 +31374,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_ LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -26853,6 +31384,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_ LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26862,6 +31394,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *e LDKMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MessageHandler_free(this_obj_conv); } @@ -26869,6 +31402,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1 LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -26878,6 +31412,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1han LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); @@ -26892,6 +31427,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_ LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -26901,6 +31437,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1ha LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); @@ -26930,6 +31467,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26937,6 +31475,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv return ret_ref; } +static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; + int64_t ret_val = SocketDescriptor_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -26959,6 +31510,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * LDKPeerHandleError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerHandleError_free(this_obj_conv); } @@ -26966,6 +31518,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1 LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv); return ret_val; } @@ -26974,6 +31527,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1conn LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); } @@ -26982,6 +31536,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26989,14 +31544,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv return ret_ref; } +static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { + LDKPeerHandleError ret_var = PeerHandleError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPeerHandleError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PeerHandleError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPeerHandleError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27008,6 +31586,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, LDKPeerManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerManager_free(this_obj_conv); } @@ -27015,6 +31594,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en LDKMessageHandler message_handler_conv; message_handler_conv.inner = (void*)(message_handler & (~1)); message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); // Warning: we need a move here but no clone is available for LDKMessageHandler LDKSecretKey our_node_secret_ref; CHECK((*env)->GetArrayLength(env, our_node_secret) == 32); @@ -27041,6 +31621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27052,6 +31633,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); @@ -27070,6 +31652,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_ LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_node_id_ref; CHECK((*env)->GetArrayLength(env, their_node_id) == 33); (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form); @@ -27089,6 +31672,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); @@ -27105,6 +31689,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_ LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -27117,6 +31702,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JN LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1); if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; @@ -27133,6 +31719,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(J LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_process_events(&this_arg_conv); } @@ -27140,6 +31727,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnec LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -27150,6 +31738,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1n LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey node_id_ref; CHECK((*env)->GetArrayLength(env, node_id) == 33); (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); @@ -27160,6 +31749,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_disconnect_all_peers(&this_arg_conv); } @@ -27167,6 +31757,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occu LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_timer_tick_occurred(&this_arg_conv); } @@ -27192,6 +31783,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transac LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); @@ -27255,6 +31847,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *e LDKTxCreationKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TxCreationKeys_free(this_obj_conv); } @@ -27262,6 +31855,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1pe LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -27271,6 +31865,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1comm LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27281,6 +31876,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1re LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27290,6 +31886,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocatio LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27300,6 +31897,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1br LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27309,6 +31907,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27319,6 +31918,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1co LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27328,6 +31928,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersi LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27338,6 +31939,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1br LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27347,6 +31949,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27373,6 +31976,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27380,14 +31984,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv return ret_ref; } +static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { + LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxCreationKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKTxCreationKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27399,6 +32026,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(J LDKTxCreationKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27420,6 +32048,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv LDKChannelPublicKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelPublicKeys_free(this_obj_conv); } @@ -27427,6 +32056,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -27436,6 +32066,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1fundin LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27446,6 +32077,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27455,6 +32087,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revoca LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27465,6 +32098,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -27474,6 +32108,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1paymen LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27484,6 +32119,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27493,6 +32129,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delaye LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27503,6 +32140,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27512,6 +32150,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1 LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27538,6 +32177,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27545,14 +32185,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE return ret_ref; } +static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelPublicKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelPublicKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27564,6 +32227,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1writ LDKChannelPublicKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27609,9 +32273,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -27635,6 +32301,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(J LDKHTLCOutputInCommitment this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCOutputInCommitment_free(this_obj_conv); } @@ -27642,6 +32309,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1ge LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv); return ret_val; } @@ -27650,6 +32318,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1o LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); } @@ -27657,6 +32326,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -27665,6 +32335,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1a LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); } @@ -27672,6 +32343,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -27680,6 +32352,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1c LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); } @@ -27687,6 +32360,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_ LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); return ret_arr; @@ -27696,6 +32370,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1p LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -27706,6 +32381,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -27716,6 +32392,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1t LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -27735,6 +32412,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27742,14 +32420,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new return ret_ref; } +static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCOutputInCommitment arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHTLCOutputInCommitment orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27761,6 +32462,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_ LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27782,9 +32484,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKTxCreationKeys keys_conv; keys_conv.inner = (void*)(keys & (~1)); keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27814,6 +32518,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transactio LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); @@ -27831,6 +32536,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelTransactionParameters_free(this_obj_conv); } @@ -27838,10 +32544,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27853,9 +32561,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } @@ -27864,6 +32574,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -27872,6 +32583,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } @@ -27879,6 +32591,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParamete LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); return ret_val; } @@ -27887,6 +32600,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); } @@ -27894,11 +32608,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27911,9 +32627,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); } @@ -27922,11 +32640,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27939,9 +32659,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } @@ -27950,19 +32672,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); LDKOutPoint funding_outpoint_arg_conv; funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27970,14 +32696,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } +static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27989,6 +32738,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyChannelTransactionParameters_free(this_obj_conv); } @@ -27996,10 +32746,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28011,9 +32763,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } @@ -28022,6 +32776,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -28030,6 +32785,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } @@ -28037,11 +32793,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKChannelPublicKeys pubkeys_arg_conv; pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28049,14 +32807,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } +static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCounterpartyChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28068,6 +32849,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParamete LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelTransactionParameters_is_populated(&this_arg_conv); return ret_val; } @@ -28076,10 +32858,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28091,10 +32875,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28106,6 +32892,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTran LDKCounterpartyChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28127,6 +32914,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParam LDKChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28148,6 +32936,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionPara LDKDirectedChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectedChannelTransactionParameters_free(this_obj_conv); } @@ -28155,10 +32944,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28170,10 +32961,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28185,6 +32978,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); return ret_val; } @@ -28193,6 +32987,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransaction LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); return ret_val; } @@ -28201,10 +32996,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28216,6 +33013,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1f LDKHolderCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HolderCommitmentTransaction_free(this_obj_conv); } @@ -28223,6 +33021,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransac LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); return ret_arr; @@ -28232,6 +33031,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -28242,6 +33042,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -28258,14 +33059,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } +static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHolderCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHolderCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28277,6 +33101,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransac LDKHolderCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28298,6 +33123,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); LDKSignature counterparty_sig_ref; CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64); @@ -28325,6 +33151,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28336,6 +33163,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1fr LDKBuiltCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BuiltCommitmentTransaction_free(this_obj_conv); } @@ -28343,6 +33171,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28354,6 +33183,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); @@ -28366,6 +33196,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv)); return ret_arr; @@ -28375,6 +33206,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -28394,6 +33226,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28401,14 +33234,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_ return ret_ref; } +static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBuiltCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBuiltCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28420,6 +33276,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28441,6 +33298,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); @@ -28454,6 +33312,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK((*env)->GetArrayLength(env, funding_key) == 32); (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); @@ -28471,17 +33330,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEn LDKClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingTransaction_free(this_obj_conv); } +static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { + LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosingTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28493,6 +33376,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JN LDKClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ClosingTransaction_hash(&o_conv); return ret_val; } @@ -28509,11 +33393,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNI LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28525,10 +33411,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(J LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28540,9 +33428,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify( LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); @@ -28553,6 +33443,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1hol LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_holder_value_sat(&this_arg_conv); return ret_val; } @@ -28561,6 +33452,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1cou LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); return ret_val; } @@ -28569,6 +33461,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_ LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28579,6 +33472,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_ LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28589,6 +33483,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1fre LDKTrustedClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedClosingTransaction_free(this_obj_conv); } @@ -28596,6 +33491,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28607,6 +33503,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); @@ -28620,6 +33517,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK((*env)->GetArrayLength(env, funding_key) == 32); (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); @@ -28637,17 +33535,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JN LDKCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentTransaction_free(this_obj_conv); } +static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28659,6 +33581,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1 LDKCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28680,6 +33603,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1comm LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_commitment_number(&this_arg_conv); return ret_val; } @@ -28688,6 +33612,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1 LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); return ret_val; } @@ -28696,6 +33621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1 LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); return ret_val; } @@ -28704,6 +33630,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feer LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = CommitmentTransaction_feerate_per_kw(&this_arg_conv); return ret_val; } @@ -28712,10 +33639,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trus LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28727,15 +33656,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1veri LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -28745,6 +33678,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1 LDKTrustedCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedCommitmentTransaction_free(this_obj_conv); } @@ -28752,6 +33686,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransa LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data); return ret_arr; @@ -28761,10 +33696,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28776,10 +33713,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28791,6 +33730,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char htlc_base_key_arr[32]; CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr); @@ -28798,6 +33738,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); return (uint64_t)ret_conv; @@ -28818,9 +33759,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *e LDKInitFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInitFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InitFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28829,9 +33772,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *e LDKNodeFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKNodeFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = NodeFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28840,9 +33785,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv LDKChannelFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKChannelFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ChannelFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28851,21 +33798,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv LDKInvoiceFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceFeatures_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInitFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InitFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInitFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28873,14 +33845,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv return ret_ref; } +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28888,14 +33883,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv return ret_ref; } +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28903,14 +33921,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIE return ret_ref; } +static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoiceFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28922,6 +33963,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env LDKInitFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InitFeatures_free(this_obj_conv); } @@ -28929,6 +33971,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env LDKNodeFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeFeatures_free(this_obj_conv); } @@ -28936,6 +33979,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * LDKChannelFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelFeatures_free(this_obj_conv); } @@ -28943,6 +33987,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv * LDKInvoiceFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceFeatures_free(this_obj_conv); } @@ -28951,6 +33996,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28963,6 +34009,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28974,6 +34021,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1un LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -28983,6 +34031,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28995,6 +34044,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29006,6 +34056,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1un LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29015,6 +34066,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29027,6 +34079,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29038,6 +34091,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_ LDKChannelFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29047,6 +34101,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29059,6 +34114,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29070,6 +34126,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_ LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29078,6 +34135,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1pa LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29086,6 +34144,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1pa LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29094,6 +34153,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_ LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29102,6 +34162,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNI LDKInitFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29113,6 +34174,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNI LDKNodeFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29124,6 +34186,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write( LDKChannelFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29135,6 +34198,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write( LDKInvoiceFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29186,17 +34250,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *e LDKShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ShutdownScript_free(this_obj_conv); } +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29208,6 +34296,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JN LDKInvalidShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvalidShutdownScript_free(this_obj_conv); } @@ -29215,6 +34304,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1 LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29225,6 +34315,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1sc LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -29241,6 +34332,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29248,14 +34340,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new( return ret_ref; } +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvalidShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvalidShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29267,6 +34382,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(J LDKShutdownScript obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29293,6 +34409,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29309,6 +34426,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29330,6 +34448,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1i LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = ShutdownScript_clone(&this_arg_conv); LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); @@ -29342,6 +34461,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1leg LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form); return ret_arr; @@ -29351,9 +34471,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compat LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInitFeatures features_conv; features_conv.inner = (void*)(features & (~1)); features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); jboolean ret_val = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_val; } @@ -29367,6 +34489,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIE CustomMessageReader_free(this_ptr_conv); } +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_val = Type_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -29398,6 +34533,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *en LDKLockableScore this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockableScore_free(this_obj_conv); } @@ -29413,6 +34549,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29424,6 +34561,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LockableScore_1write(JN LDKLockableScore obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29435,17 +34573,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jcla LDKNodeId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeId_free(this_obj_conv); } +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeId_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeId ret_var = NodeId_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29461,6 +34623,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29472,6 +34635,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEn LDKNodeId this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29482,6 +34646,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, j LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = NodeId_hash(&o_conv); return ret_val; } @@ -29490,6 +34655,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *e LDKNodeId obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29511,17 +34677,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env LDKNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetworkGraph_free(this_obj_conv); } +static inline uint64_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { + LDKNetworkGraph ret_var = NetworkGraph_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetworkGraph arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NetworkGraph_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetworkGraph orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29533,6 +34723,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNI LDKReadOnlyNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReadOnlyNetworkGraph_free(this_obj_conv); } @@ -29545,6 +34736,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *en NetworkUpdate_free(this_ptr_conv); } +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)arg; + int64_t ret_val = NetworkUpdate_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)orig; LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); @@ -29557,6 +34760,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1upd LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_update_message(msg_conv); @@ -29590,10 +34794,21 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JN return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -29603,6 +34818,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEn LDKNetGraphMsgHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetGraphMsgHandler_free(this_obj_conv); } @@ -29610,6 +34826,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -29632,6 +34849,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29643,6 +34861,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -29661,6 +34880,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Rou LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -29670,6 +34890,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Mes LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -29679,6 +34900,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(J LDKDirectionalChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectionalChannelInfo_free(this_obj_conv); } @@ -29686,6 +34908,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = DirectionalChannelInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -29694,6 +34917,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_last_update(&this_ptr_conv, val); } @@ -29701,6 +34925,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1ge LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = DirectionalChannelInfo_get_enabled(&this_ptr_conv); return ret_val; } @@ -29709,6 +34934,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1e LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_enabled(&this_ptr_conv, val); } @@ -29716,6 +34942,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -29724,6 +34951,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1c LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -29731,6 +34959,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DirectionalChannelInfo_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -29739,6 +34968,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -29746,6 +34976,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -29756,6 +34987,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -29767,10 +34999,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29782,9 +35016,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1f LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); DirectionalChannelInfo_set_fees(&this_ptr_conv, val_conv); } @@ -29793,11 +35029,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29810,9 +35048,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelUpdate_clone(&val_conv); DirectionalChannelInfo_set_last_update_message(&this_ptr_conv, val_conv); } @@ -29825,15 +35065,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); LDKChannelUpdate last_update_message_arg_conv; last_update_message_arg_conv.inner = (void*)(last_update_message_arg & (~1)); last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29841,14 +35084,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new return ret_ref; } +static inline uint64_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg) { + LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDirectionalChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDirectionalChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29860,6 +35126,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_ LDKDirectionalChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29881,6 +35148,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, LDKChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelInfo_free(this_obj_conv); } @@ -29888,10 +35156,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features( LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29903,9 +35173,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNI LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); ChannelInfo_set_features(&this_ptr_conv, val_conv); } @@ -29914,10 +35186,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29929,9 +35203,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JN LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } @@ -29940,11 +35216,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29957,9 +35235,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); } @@ -29968,10 +35248,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29983,9 +35265,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JN LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } @@ -29994,11 +35278,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30011,9 +35297,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } @@ -30022,6 +35310,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -30032,6 +35321,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sa LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -30043,11 +35333,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcem LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30060,9 +35352,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelAnnouncement_clone(&val_conv); ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -30071,22 +35365,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en LDKChannelFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = ChannelFeatures_clone(&features_arg_conv); LDKNodeId node_one_arg_conv; node_one_arg_conv.inner = (void*)(node_one_arg & (~1)); node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv); node_one_arg_conv = NodeId_clone(&node_one_arg_conv); LDKDirectionalChannelInfo one_to_two_arg_conv; one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1)); one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv); one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv); LDKNodeId node_two_arg_conv; node_two_arg_conv.inner = (void*)(node_two_arg & (~1)); node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv); node_two_arg_conv = NodeId_clone(&node_two_arg_conv); LDKDirectionalChannelInfo two_to_one_arg_conv; two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1)); two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv); two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv); void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1); CHECK_ACCESS(capacity_sats_arg_ptr); @@ -30095,11 +35394,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en LDKChannelAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv); LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30107,14 +35408,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en return ret_ref; } +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30126,6 +35450,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIE LDKChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30147,6 +35472,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, LDKRoutingFees this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RoutingFees_free(this_obj_conv); } @@ -30154,6 +35480,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msa LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_base_msat(&this_ptr_conv); return ret_val; } @@ -30162,6 +35489,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(J LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_base_msat(&this_ptr_conv, val); } @@ -30169,6 +35497,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportio LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -30177,6 +35506,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } @@ -30185,6 +35515,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *en uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30196,21 +35527,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *en LDKRoutingFees a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoutingFees b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RoutingFees_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RoutingFees_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRoutingFees orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30222,6 +35578,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *e LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RoutingFees_hash(&o_conv); return ret_val; } @@ -30230,6 +35587,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIE LDKRoutingFees obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30251,6 +35609,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNI LDKNodeAnnouncementInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncementInfo_free(this_obj_conv); } @@ -30258,10 +35617,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30273,9 +35634,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1fea LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); } @@ -30284,6 +35647,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -30292,6 +35656,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1las LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); } @@ -30299,6 +35664,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1g LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 3); (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv)); return ret_arr; @@ -30308,6 +35674,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 3); (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); @@ -30318,6 +35685,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1g LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(&this_ptr_conv)); return ret_arr; @@ -30327,6 +35695,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ali LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -30337,6 +35706,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1add LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -30360,11 +35730,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30377,9 +35749,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ann LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncement_clone(&val_conv); NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -30388,6 +35762,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J LDKNodeFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = NodeFeatures_clone(&features_arg_conv); LDKThreeBytes rgb_arg_ref; CHECK((*env)->GetArrayLength(env, rgb_arg) == 3); @@ -30413,11 +35788,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J LDKNodeAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, announcement_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30425,14 +35802,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J return ret_ref; } +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncementInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeAnnouncementInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30444,6 +35844,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1w LDKNodeAnnouncementInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30465,6 +35866,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jc LDKNodeInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeInfo_free(this_obj_conv); } @@ -30472,6 +35874,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -30491,11 +35894,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbo LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30508,9 +35913,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv); } @@ -30519,11 +35926,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30536,9 +35945,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1i LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncementInfo_clone(&val_conv); NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } @@ -30559,15 +35970,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, LDKRoutingFees lowest_inbound_channel_fees_arg_conv; lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1)); lowest_inbound_channel_fees_arg_conv.is_owned = (lowest_inbound_channel_fees_arg & 1) || (lowest_inbound_channel_fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv); lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv); LDKNodeAnnouncementInfo announcement_info_arg_conv; announcement_info_arg_conv.inner = (void*)(announcement_info_arg & (~1)); announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30575,14 +35989,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30594,6 +36031,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv LDKNodeInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30615,6 +36053,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNI LDKNetworkGraph obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30640,6 +36079,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30651,10 +36091,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JN LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30666,9 +36108,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30678,9 +36122,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30690,9 +36136,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -30713,9 +36161,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -30736,6 +36186,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1 LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent); } @@ -30743,6 +36194,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node(JNIEn LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey _node_id_ref; CHECK((*env)->GetArrayLength(env, _node_id) == 33); (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form); @@ -30753,9 +36205,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30765,9 +36219,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30777,6 +36233,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1 LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey pubkey_ref; CHECK((*env)->GetArrayLength(env, pubkey) == 33); (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); @@ -30790,6 +36247,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jc LDKRouteHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHop_free(this_obj_conv); } @@ -30797,6 +36255,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(J LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -30806,6 +36265,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -30816,10 +36276,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1featur LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30831,9 +36293,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features( LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); RouteHop_set_node_features(&this_ptr_conv, val_conv); } @@ -30842,6 +36306,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1chann LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -30850,6 +36315,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_ LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_short_channel_id(&this_ptr_conv, val); } @@ -30857,10 +36323,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1fea LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30872,9 +36340,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1featur LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); RouteHop_set_channel_features(&this_ptr_conv, val_conv); } @@ -30883,6 +36353,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JN LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_fee_msat(&this_ptr_conv); return ret_val; } @@ -30891,6 +36362,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEn LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_fee_msat(&this_ptr_conv, val); } @@ -30898,6 +36370,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -30906,6 +36379,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1d LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -30916,15 +36390,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, LDKNodeFeatures node_features_arg_conv; node_features_arg_conv.inner = (void*)(node_features_arg & (~1)); node_features_arg_conv.is_owned = (node_features_arg & 1) || (node_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); LDKChannelFeatures channel_features_arg_conv; channel_features_arg_conv.inner = (void*)(channel_features_arg & (~1)); channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30932,14 +36409,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHop_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHop ret_var = RouteHop_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30951,6 +36451,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHop_hash(&o_conv); return ret_val; } @@ -30959,9 +36460,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, LDKRouteHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHop_eq(&a_conv, &b_conv); return ret_val; } @@ -30970,6 +36473,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv LDKRouteHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30991,6 +36495,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclas LDKRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Route_free(this_obj_conv); } @@ -30998,6 +36503,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIE LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL); @@ -31012,6 +36518,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIE uint64_t ret_conv_12_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var); ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner; if (ret_conv_12_conv_10_var.is_owned) { ret_conv_12_conv_10_ref |= 1; @@ -31031,6 +36538,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31051,6 +36559,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, LDKRouteHop val_conv_12_conv_10_conv; val_conv_12_conv_10_conv.inner = (void*)(val_conv_12_conv_10 & (~1)); val_conv_12_conv_10_conv.is_owned = (val_conv_12_conv_10 & 1) || (val_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv); val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv); val_conv_12_constr.data[k] = val_conv_12_conv_10_conv; } @@ -31064,11 +36573,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payee(JNIEnv *e LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = Route_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31081,9 +36592,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payee(JNIEnv *env, LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); Route_set_payee(&this_ptr_conv, val_conv); } @@ -31109,6 +36622,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl LDKRouteHop paths_arg_conv_12_conv_10_conv; paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1)); paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv; } @@ -31118,11 +36632,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRoute ret_var = Route_new(paths_arg_constr, payee_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31130,14 +36646,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl return ret_ref; } +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Route_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoute ret_var = Route_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31149,6 +36688,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jc LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Route_hash(&o_conv); return ret_val; } @@ -31157,9 +36697,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jcl LDKRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Route_eq(&a_conv, &b_conv); return ret_val; } @@ -31168,6 +36710,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNI LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_fees(&this_arg_conv); return ret_val; } @@ -31176,6 +36719,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(J LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_amount(&this_arg_conv); return ret_val; } @@ -31184,6 +36728,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *en LDKRoute obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Route_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31205,6 +36750,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv * LDKRouteParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteParameters_free(this_obj_conv); } @@ -31212,10 +36758,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payee LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31227,9 +36775,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payee(JN LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); RouteParameters_set_payee(&this_ptr_conv, val_conv); } @@ -31238,6 +36788,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_val; } @@ -31246,6 +36797,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1v LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_value_msat(&this_ptr_conv, val); } @@ -31253,6 +36805,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -31261,6 +36814,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1c LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val); } @@ -31268,11 +36822,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31280,14 +36836,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv return ret_ref; } +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31299,6 +36878,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write( LDKRouteParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31320,6 +36900,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclas LDKPayee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Payee_free(this_obj_conv); } @@ -31327,6 +36908,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1pubkey(JNIE LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Payee_get_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -31336,6 +36918,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1pubkey(JNIEnv *env LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -31346,11 +36929,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1features(JNIEnv LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures ret_var = Payee_get_features(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31363,9 +36948,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1features(JNIEnv *e LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InvoiceFeatures_clone(&val_conv); Payee_set_features(&this_ptr_conv, val_conv); } @@ -31374,6 +36961,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hin LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -31383,6 +36971,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hin uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -31398,6 +36987,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEn LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31410,6 +37000,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEn LDKRouteHint val_conv_11_conv; val_conv_11_conv.inner = (void*)(val_conv_11 & (~1)); val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv); val_conv_11_conv = RouteHint_clone(&val_conv_11_conv); val_constr.data[l] = val_conv_11_conv; } @@ -31421,6 +37012,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1expiry_1time(JN LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Payee_get_expiry_time(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31431,6 +37023,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1expiry_1time(JNIEn LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31445,6 +37038,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl LDKInvoiceFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InvoiceFeatures_clone(&features_arg_conv); LDKCVec_RouteHintZ route_hints_arg_constr; route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg); @@ -31458,6 +37052,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl LDKRouteHint route_hints_arg_conv_11_conv; route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1)); route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv); route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv); route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv; } @@ -31470,6 +37065,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31477,14 +37073,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl return ret_ref; } +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee ret_var = Payee_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPayee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Payee_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPayee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayee ret_var = Payee_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31496,6 +37115,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jc LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Payee_hash(&o_conv); return ret_val; } @@ -31504,9 +37124,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jcl LDKPayee a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayee b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Payee_eq(&a_conv, &b_conv); return ret_val; } @@ -31515,6 +37137,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1write(JNIEnv *en LDKPayee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Payee_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31540,6 +37163,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1from_1node_1id(JNIEn uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31555,6 +37179,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1for_1keysend(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31566,6 +37191,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, j LDKRouteHint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHint_free(this_obj_conv); } @@ -31573,6 +37199,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIE LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -31582,6 +37209,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIE uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -31597,6 +37225,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31609,6 +37238,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, LDKRouteHintHop val_conv_14_conv; val_conv_14_conv.inner = (void*)(val_conv_14 & (~1)); val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); val_constr.data[o] = val_conv_14_conv; } @@ -31629,6 +37259,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, LDKRouteHintHop a_arg_conv_14_conv; a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1)); a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); a_arg_constr.data[o] = a_arg_conv_14_conv; } @@ -31637,6 +37268,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31644,14 +37276,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHint_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHint ret_var = RouteHint_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31663,6 +37318,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHint_hash(&o_conv); return ret_val; } @@ -31671,9 +37327,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, LDKRouteHint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHint_eq(&a_conv, &b_conv); return ret_val; } @@ -31682,6 +37340,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv LDKRouteHint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31703,6 +37362,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env LDKRouteHintHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHintHop_free(this_obj_conv); } @@ -31710,6 +37370,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_ LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -31719,6 +37380,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1 LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -31729,6 +37391,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1c LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHintHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -31737,6 +37400,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1chan LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_short_channel_id(&this_ptr_conv, val); } @@ -31744,10 +37408,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNI LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31759,9 +37425,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); RouteHintHop_set_fees(&this_ptr_conv, val_conv); } @@ -31770,6 +37438,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1ex LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -31778,6 +37447,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expir LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -31785,6 +37455,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1mi LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31795,6 +37466,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minim LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31806,6 +37478,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1ma LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31816,6 +37489,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maxim LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31830,6 +37504,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1); CHECK_ACCESS(htlc_minimum_msat_arg_ptr); @@ -31843,6 +37518,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31850,14 +37526,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e return ret_ref; } +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHintHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHintHop_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHintHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31869,6 +37568,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv * LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHintHop_hash(&o_conv); return ret_val; } @@ -31877,9 +37577,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *e LDKRouteHintHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHintHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHintHop_eq(&a_conv, &b_conv); return ret_val; } @@ -31888,6 +37590,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNI LDKRouteHintHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31912,9 +37615,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKNetworkGraph network_conv; network_conv.inner = (void*)(network & (~1)); network_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -31929,6 +37634,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); @@ -31954,6 +37660,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free(JNIEnv *env, jcla LDKScorer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Scorer_free(this_obj_conv); } @@ -31961,6 +37668,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free(JNIEnv LDKScoringParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ScoringParameters_free(this_obj_conv); } @@ -31968,6 +37676,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1bas LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv); return ret_val; } @@ -31976,6 +37685,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1 LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val); } @@ -31983,6 +37693,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1fai LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv); return ret_val; } @@ -31991,6 +37702,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failur LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val); } @@ -31998,6 +37710,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1fai LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv); return ret_val; } @@ -32006,6 +37719,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failur LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val); } @@ -32014,6 +37728,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32025,6 +37740,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1writ LDKScoringParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -32046,11 +37762,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1new(JNIEnv *env, jc LDKScoringParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKScorer ret_var = Scorer_new(params_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32063,6 +37781,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32075,6 +37794,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32086,6 +37806,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1as_1Score(JNIEnv *e LDKScorer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); *ret_ret = Scorer_as_Score(&this_arg_conv); return (uint64_t)ret_ret; @@ -32095,6 +37816,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write(JNIEnv *e LDKScorer obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Scorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -32116,6 +37838,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIE LDKFilesystemPersister this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FilesystemPersister_free(this_obj_conv); } @@ -32125,6 +37848,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JN uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32136,6 +37860,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -32147,6 +37872,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persis LDKChannelManager manager_conv; manager_conv.inner = (void*)(manager & (~1)); manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = FilesystemPersister_persist_manager(data_dir_conv, &manager_conv); return (uint64_t)ret_conv; @@ -32156,6 +37882,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1 LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -32172,6 +37899,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1as_1Pe LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); *ret_ret = FilesystemPersister_as_Persist(&this_arg_conv); return (uint64_t)ret_ret; @@ -32181,6 +37909,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIE LDKBackgroundProcessor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BackgroundProcessor_free(this_obj_conv); } @@ -32211,15 +37940,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( LDKChainMonitor chain_monitor_conv; chain_monitor_conv.inner = (void*)(chain_monitor & (~1)); chain_monitor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv); LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKNetGraphMsgHandler net_graph_msg_handler_conv; net_graph_msg_handler_conv.inner = (void*)(net_graph_msg_handler & (~1)); net_graph_msg_handler_conv.is_owned = (net_graph_msg_handler & 1) || (net_graph_msg_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(net_graph_msg_handler_conv); LDKPeerManager peer_manager_conv; peer_manager_conv.inner = (void*)(peer_manager & (~1)); peer_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -32231,6 +37964,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32242,6 +37976,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1join(J LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_join(this_arg_conv); @@ -32252,6 +37987,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(J LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_stop(this_arg_conv); @@ -32266,6 +38002,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jcl LDKInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Invoice_free(this_obj_conv); } @@ -32273,21 +38010,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq(JNIEnv *env, j LDKInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Invoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) { + LDKInvoice ret_var = Invoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Invoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoice ret_var = Invoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32299,6 +38061,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free(JNIEnv LDKSignedRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); SignedRawInvoice_free(this_obj_conv); } @@ -32306,21 +38069,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq(JNIEn LDKSignedRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSignedRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = SignedRawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) { + LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSignedRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = SignedRawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSignedRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32332,6 +38120,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1free(JNIEnv *env, LDKRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawInvoice_free(this_obj_conv); } @@ -32339,10 +38128,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1get_1data(JNIEn LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32354,9 +38145,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data(JNIEnv * LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RawDataPart_clone(&val_conv); RawInvoice_set_data(&this_ptr_conv, val_conv); } @@ -32365,21 +38158,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq(JNIEnv *env LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) { + LDKRawInvoice ret_var = RawInvoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32391,6 +38209,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1free(JNIEnv *env, LDKRawDataPart this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawDataPart_free(this_obj_conv); } @@ -32398,10 +38217,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1get_1timestamp LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32413,9 +38234,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp(JN LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = PositiveTimestamp_clone(&val_conv); RawDataPart_set_timestamp(&this_ptr_conv, val_conv); } @@ -32424,21 +38247,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq(JNIEnv *en LDKRawDataPart a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawDataPart b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawDataPart_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) { + LDKRawDataPart ret_var = RawDataPart_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRawDataPart arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawDataPart_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRawDataPart orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32450,6 +38298,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free(JNIEnv LDKPositiveTimestamp this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PositiveTimestamp_free(this_obj_conv); } @@ -32457,21 +38306,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq(JNIE LDKPositiveTimestamp a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPositiveTimestamp b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PositiveTimestamp_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) { + LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPositiveTimestamp arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PositiveTimestamp_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPositiveTimestamp orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32566,17 +38440,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free(JNIEnv *env, jcla LDKSha256 this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Sha256_free(this_obj_conv); } +static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) { + LDKSha256 ret_var = Sha256_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSha256 arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Sha256_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSha256 orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSha256 ret_var = Sha256_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32588,6 +38486,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1hash(JNIEnv *env, j LDKSha256 o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Sha256_hash(&o_conv); return ret_val; } @@ -32596,9 +38495,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq(JNIEnv *env, jc LDKSha256 a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSha256 b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Sha256_eq(&a_conv, &b_conv); return ret_val; } @@ -32607,17 +38508,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free(JNIEnv *env, LDKDescription this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Description_free(this_obj_conv); } +static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) { + LDKDescription ret_var = Description_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDescription arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Description_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDescription orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDescription ret_var = Description_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32629,6 +38554,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1hash(JNIEnv *e LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Description_hash(&o_conv); return ret_val; } @@ -32637,9 +38563,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Description_1eq(JNIEnv *en LDKDescription a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKDescription b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Description_eq(&a_conv, &b_conv); return ret_val; } @@ -32648,6 +38576,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free(JNIEnv *env, LDKPayeePubKey this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PayeePubKey_free(this_obj_conv); } @@ -32655,6 +38584,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNI LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form); return ret_arr; @@ -32664,6 +38594,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *en LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -32678,6 +38609,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *en uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32685,14 +38617,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *en return ret_ref; } +static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) { + LDKPayeePubKey ret_var = PayeePubKey_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPayeePubKey arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PayeePubKey_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPayeePubKey orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32704,6 +38659,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1hash(JNIEnv *e LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PayeePubKey_hash(&o_conv); return ret_val; } @@ -32712,9 +38668,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq(JNIEnv *en LDKPayeePubKey a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayeePubKey b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PayeePubKey_eq(&a_conv, &b_conv); return ret_val; } @@ -32723,17 +38681,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free(JNIEnv *env, LDKExpiryTime this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ExpiryTime_free(this_obj_conv); } +static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) { + LDKExpiryTime ret_var = ExpiryTime_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKExpiryTime arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ExpiryTime_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKExpiryTime orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32745,6 +38727,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1hash(JNIEnv *en LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ExpiryTime_hash(&o_conv); return ret_val; } @@ -32753,9 +38736,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1eq(JNIEnv *env LDKExpiryTime a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKExpiryTime b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ExpiryTime_eq(&a_conv, &b_conv); return ret_val; } @@ -32764,6 +38749,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1free(JNIEn LDKMinFinalCltvExpiry this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MinFinalCltvExpiry_free(this_obj_conv); } @@ -32771,6 +38757,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a( LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv); return ret_val; } @@ -32779,6 +38766,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a(JNI LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); MinFinalCltvExpiry_set_a(&this_ptr_conv, val); } @@ -32787,6 +38775,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNI uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32794,14 +38783,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNI return ret_ref; } +static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) { + LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMinFinalCltvExpiry arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MinFinalCltvExpiry_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMinFinalCltvExpiry orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32813,6 +38825,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1hash(JN LDKMinFinalCltvExpiry o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MinFinalCltvExpiry_hash(&o_conv); return ret_val; } @@ -32821,9 +38834,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1eq(JNI LDKMinFinalCltvExpiry a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMinFinalCltvExpiry b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MinFinalCltvExpiry_eq(&a_conv, &b_conv); return ret_val; } @@ -32837,6 +38852,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jc Fallback_free(this_ptr_conv); } +static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) { + LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); + *ret_copy = Fallback_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFallback* arg_conv = (LDKFallback*)arg; + int64_t ret_val = Fallback_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFallback* orig_conv = (LDKFallback*)orig; LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); @@ -32894,17 +38921,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free(JNIEnv LDKInvoiceSignature this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceSignature_free(this_obj_conv); } +static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) { + LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceSignature arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceSignature_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoiceSignature orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32916,9 +38967,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq(JNIEn LDKInvoiceSignature a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceSignature b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceSignature_eq(&a_conv, &b_conv); return ret_val; } @@ -32927,17 +38980,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free(JNIEnv *env LDKPrivateRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PrivateRoute_free(this_obj_conv); } +static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) { + LDKPrivateRoute ret_var = PrivateRoute_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPrivateRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PrivateRoute_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPrivateRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32949,6 +39026,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1hash(JNIEnv * LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PrivateRoute_hash(&o_conv); return ret_val; } @@ -32957,9 +39035,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1eq(JNIEnv *e LDKPrivateRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPrivateRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PrivateRoute_eq(&a_conv, &b_conv); return ret_val; } @@ -32968,6 +39048,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1into_1par LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = SignedRawInvoice_clone(&this_arg_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = SignedRawInvoice_into_parts(this_arg_conv); @@ -32978,10 +39059,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1raw_1invo LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32993,6 +39076,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1hash( LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SignedRawInvoice_hash(&this_arg_conv)); return ret_arr; @@ -33002,10 +39086,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signature LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33017,6 +39103,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1recover_1 LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv); return (uint64_t)ret_conv; @@ -33026,6 +39113,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1check_1s LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = SignedRawInvoice_check_signature(&this_arg_conv); return ret_val; } @@ -33034,6 +39122,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1hash(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_hash(&this_arg_conv).data); return ret_arr; @@ -33043,11 +39132,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1hash(J LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33060,11 +39151,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description(JNI LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDescription ret_var = RawInvoice_description(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33077,11 +39170,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payee_1pub_1key LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33094,11 +39189,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description_1ha LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33111,11 +39208,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1expiry_1time(JN LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33128,11 +39227,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1min_1final_1clt LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33145,6 +39246,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1se LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_payment_secret(&this_arg_conv).data); return ret_arr; @@ -33154,11 +39256,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1features(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33171,6 +39275,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1r LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33180,6 +39285,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1r uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -33195,6 +39301,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1amount_1pico_1b LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -33205,6 +39312,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RawInvoice_1currency(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jclass ret_conv = LDKCurrency_to_java(env, RawInvoice_currency(&this_arg_conv)); return ret_conv; } @@ -33225,6 +39333,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1unix LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_unix_timestamp(&this_arg_conv); return ret_val; } @@ -33233,6 +39342,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1time LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_time(&this_arg_conv); return ret_val; } @@ -33241,11 +39351,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1into_1signed_1raw( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Invoice_clone(&this_arg_conv); LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33257,6 +39369,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1check_1signature(J LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); *ret_conv = Invoice_check_signature(&this_arg_conv); return (uint64_t)ret_conv; @@ -33266,6 +39379,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1signed(JNIEn LDKSignedRawInvoice signed_invoice_conv; signed_invoice_conv.inner = (void*)(signed_invoice & (~1)); signed_invoice_conv.is_owned = (signed_invoice & 1) || (signed_invoice == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv); signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = Invoice_from_signed(signed_invoice_conv); @@ -33276,6 +39390,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1timestamp(JNIEnv * LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_timestamp(&this_arg_conv); return ret_val; } @@ -33284,6 +39399,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1hash( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_hash(&this_arg_conv)); return ret_arr; @@ -33293,6 +39409,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payee_1pub_1ke LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_payee_pub_key(&this_arg_conv).compressed_form); return ret_arr; @@ -33302,6 +39419,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1secre LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv)); return ret_arr; @@ -33311,11 +39429,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1features(JNIEnv *e LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33328,6 +39448,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1recover_1payee LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form); return ret_arr; @@ -33337,6 +39458,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time(JNIEn LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_expiry_time(&this_arg_conv); return ret_val; } @@ -33345,6 +39467,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEn LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = Invoice_is_expired(&this_arg_conv); return ret_val; } @@ -33353,6 +39476,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1 LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_min_final_cltv_expiry(&this_arg_conv); return ret_val; } @@ -33361,6 +39485,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1rout LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33370,6 +39495,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1rout uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -33385,6 +39511,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33394,6 +39521,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints( uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -33409,6 +39537,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Invoice_1currency(JNIEnv *en LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jclass ret_conv = LDKCurrency_to_java(env, Invoice_currency(&this_arg_conv)); return ret_conv; } @@ -33417,6 +39546,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1sat LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -33434,6 +39564,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JN LDKDescription this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Description_clone(&this_arg_conv); LDKStr ret_str = Description_into_inner(this_arg_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); @@ -33457,6 +39588,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1seconds(JNI LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_seconds(&this_arg_conv); return ret_val; } @@ -33465,6 +39597,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1duration(JN LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_duration(&this_arg_conv); return ret_val; } @@ -33473,6 +39606,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1new(JNIEnv *e LDKRouteHint hops_conv; hops_conv.inner = (void*)(hops & (~1)); hops_conv.is_owned = (hops & 1) || (hops == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv); hops_conv = RouteHint_clone(&hops_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = PrivateRoute_new(hops_conv); @@ -33483,11 +39617,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner(J LDKPrivateRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = PrivateRoute_clone(&this_arg_conv); LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33616,6 +39752,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIE SignOrCreationError_free(this_ptr_conv); } +static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) { + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = SignOrCreationError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)arg; + int64_t ret_val = SignOrCreationError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)orig; LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); @@ -33658,6 +39806,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free(JNIEnv *env LDKInvoicePayer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoicePayer_free(this_obj_conv); } @@ -33683,6 +39832,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free(JNIEnv *en LDKRetryAttempts this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RetryAttempts_free(this_obj_conv); } @@ -33690,6 +39840,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a(JNIEn LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv); return ret_val; } @@ -33698,6 +39849,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a(JNIEnv * LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RetryAttempts_set_a(&this_ptr_conv, val); } @@ -33706,6 +39858,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33713,14 +39866,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv * return ret_ref; } +static inline uint64_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg) { + LDKRetryAttempts ret_var = RetryAttempts_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRetryAttempts arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RetryAttempts_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRetryAttempts orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRetryAttempts ret_var = RetryAttempts_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33732,9 +39908,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1eq(JNIEnv * LDKRetryAttempts a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRetryAttempts b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv); return ret_val; } @@ -33743,6 +39921,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash(JNIEnv LDKRetryAttempts o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RetryAttempts_hash(&o_conv); return ret_val; } @@ -33756,6 +39935,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free(JNIEnv *env PaymentError_free(this_ptr_conv); } +static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) { + LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); + *ret_copy = PaymentError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentError* arg_conv = (LDKPaymentError*)arg; + int64_t ret_val = PaymentError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentError* orig_conv = (LDKPaymentError*)orig; LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); @@ -33776,6 +39967,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing(JNIEn LDKLightningError a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = LightningError_clone(&a_conv); LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); *ret_copy = PaymentError_routing(a_conv); @@ -33812,6 +40004,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e LDKLockableScore scorer_conv; scorer_conv.inner = (void*)(scorer & (~1)); scorer_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -33829,11 +40022,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e LDKRetryAttempts retry_attempts_conv; retry_attempts_conv.inner = (void*)(retry_attempts & (~1)); retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_attempts_conv); retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv); LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33845,9 +40040,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice( LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv); return (uint64_t)ret_conv; @@ -33857,9 +40054,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1va LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats); return (uint64_t)ret_conv; @@ -33869,6 +40068,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1 LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); @@ -33880,6 +40080,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHand LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -33889,6 +40090,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -33911,6 +40113,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *en LDKDefaultRouter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DefaultRouter_free(this_obj_conv); } @@ -33918,6 +40121,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv * LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -33929,6 +40133,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33940,6 +40145,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(J LDKDefaultRouter this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); *ret_ret = DefaultRouter_as_Router(&this_arg_conv); return (uint64_t)ret_ret; @@ -33949,6 +40155,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(J LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer"); *ret_ret = ChannelManager_as_Payer(&this_arg_conv); return (uint64_t)ret_ret; @@ -33979,6 +40186,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *en LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = Invoice_to_str(&o_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -33989,6 +40197,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(J LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = SignedRawInvoice_to_str(&o_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index 3b193337..869ef719 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -11,6 +11,7 @@ #define MALLOC(a, _) malloc(a) #define FREE(p) if ((uint64_t)(p) > 4096) { free(p); } #define CHECK_ACCESS(p) +#define CHECK_INNER_FIELD_ACCESS_OR_NULL(v) #define DO_ASSERT(a) (void)(a) #define CHECK(a) @@ -721,21 +722,6 @@ static inline jclass LDKSiPrefix_to_java(JNIEnv *env, LDKSiPrefix val) { } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1new(JNIEnv *env, jclass clz, int8_tArray elems) { - LDKCVec_u8Z *ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVec_u8Z Data"); - int8_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen); @@ -756,9 +742,6 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}JNIEXPO return ret_val; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SecretKeyErrorZ *val = (LDKCResult_SecretKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -772,9 +755,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_ jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PublicKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PublicKeyErrorZ *val = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -788,9 +768,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_ jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxCreationKeysDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -798,6 +775,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -808,12 +786,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelPublicKeysDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -821,6 +797,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -831,12 +808,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxCreationKeysErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -844,6 +819,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -881,9 +857,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -891,6 +864,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCom uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -901,12 +875,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCom uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -914,6 +886,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyCha uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -924,12 +897,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyCha uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -937,6 +908,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransact uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -947,12 +919,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransact uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -960,6 +930,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -970,12 +941,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -983,6 +952,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitment uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -993,12 +963,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitment uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TrustedClosingTransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1006,6 +974,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingT uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1014,9 +983,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTran CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1024,6 +990,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTrans uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1034,12 +1001,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTrans uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TrustedCommitmentTransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1047,6 +1012,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitme uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1055,9 +1021,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentT CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok; -} JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1078,9 +1041,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNo CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownScriptDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1088,6 +1048,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1098,12 +1059,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); CHECK(val->result_ok); @@ -1111,6 +1070,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptI uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1121,12 +1081,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptI uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneErrorZ *val = (LDKCResult_NoneErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1138,9 +1096,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_ jclass err_conv = LDKIOError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHopDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1148,6 +1103,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1158,29 +1114,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVec_RouteHopZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKRouteHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1195,9 +1132,6 @@ static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_C } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1205,6 +1139,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1215,12 +1150,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1228,6 +1161,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParameters uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1238,29 +1172,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParameters uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKRouteHint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1296,9 +1211,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1306,6 +1218,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1316,29 +1229,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKRouteHintHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHintHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1346,9 +1240,6 @@ static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_Route } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1356,6 +1247,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1366,12 +1258,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1379,6 +1269,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1389,29 +1280,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKChannelDetails arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelDetails_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1419,9 +1291,6 @@ static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_C } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1429,6 +1298,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1439,12 +1309,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1478,26 +1346,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransacti return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_usizeTransactionZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "LDKCVec_C2Tuple_usizeTransactionZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * ret->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1512,9 +1360,6 @@ static inline LDKCVec_TxidZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_TxidZ *orig } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); CHECK(val->result_ok); @@ -1564,6 +1409,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t htlc_event_ref = 0; CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref); } @@ -1572,6 +1418,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t commitment_tx_confirmed_ref = 0; CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref); } @@ -1580,6 +1427,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, obj->update_completed.monitor_update_id); } @@ -1588,32 +1436,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t update_failed_ref = 0; CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); update_failed_ref = (uint64_t)update_failed_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVec_MonitorEventZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr); - arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1652,6 +1481,134 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeT default: abort(); } } +static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL; +static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL; +static jclass LDKClosureReason_HolderForceClosed_class = NULL; +static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL; +static jclass LDKClosureReason_CooperativeClosure_class = NULL; +static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL; +static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL; +static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL; +static jclass LDKClosureReason_ProcessingError_class = NULL; +static jmethodID LDKClosureReason_ProcessingError_meth = NULL; +static jclass LDKClosureReason_DisconnectedPeer_class = NULL; +static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL; +static jclass LDKClosureReason_OutdatedChannelManager_class = NULL; +static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) { + LDKClosureReason_CounterpartyForceClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;")); + CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL); + LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL); + LDKClosureReason_HolderForceClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;")); + CHECK(LDKClosureReason_HolderForceClosed_class != NULL); + LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "()V"); + CHECK(LDKClosureReason_HolderForceClosed_meth != NULL); + LDKClosureReason_CooperativeClosure_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;")); + CHECK(LDKClosureReason_CooperativeClosure_class != NULL); + LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "", "()V"); + CHECK(LDKClosureReason_CooperativeClosure_meth != NULL); + LDKClosureReason_CommitmentTxConfirmed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;")); + CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL); + LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "", "()V"); + CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL); + LDKClosureReason_ProcessingError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;")); + CHECK(LDKClosureReason_ProcessingError_class != NULL); + LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKClosureReason_ProcessingError_meth != NULL); + LDKClosureReason_DisconnectedPeer_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;")); + CHECK(LDKClosureReason_DisconnectedPeer_class != NULL); + LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "", "()V"); + CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL); + LDKClosureReason_OutdatedChannelManager_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;")); + CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL); + LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "", "()V"); + CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); + switch(obj->tag) { + case LDKClosureReason_CounterpartyForceClosed: { + LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; + jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len); + return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv); + } + case LDKClosureReason_HolderForceClosed: { + return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth); + } + case LDKClosureReason_CooperativeClosure: { + return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth); + } + case LDKClosureReason_CommitmentTxConfirmed: { + return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth); + } + case LDKClosureReason_ProcessingError: { + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv); + } + case LDKClosureReason_DisconnectedPeer: { + return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth); + } + case LDKClosureReason_OutdatedChannelManager: { + return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth); + } + default: abort(); + } +} +static jclass LDKCOption_ClosureReasonZ_Some_class = NULL; +static jmethodID LDKCOption_ClosureReasonZ_Some_meth = NULL; +static jclass LDKCOption_ClosureReasonZ_None_class = NULL; +static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) { + LDKCOption_ClosureReasonZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some;")); + CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL); + LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL); + LDKCOption_ClosureReasonZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None;")); + CHECK(LDKCOption_ClosureReasonZ_None_class != NULL); + LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "", "()V"); + CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_ClosureReasonZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_Some_class, LDKCOption_ClosureReasonZ_Some_meth, some_ref); + } + case LDKCOption_ClosureReasonZ_None: { + return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_None_class, LDKCOption_ClosureReasonZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; static jclass LDKNetworkUpdate_ChannelClosed_class = NULL; @@ -1683,6 +1640,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref); } @@ -1757,6 +1715,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t outpoint_ref = 0; CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); outpoint_ref = (uint64_t)outpoint_var.inner & ~1; uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (uint64_t)output_ref); @@ -1766,6 +1725,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t delayed_payment_output_ref = 0; CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var); delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref); } @@ -1774,32 +1734,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t static_payment_output_ref = 0; CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var); static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_SpendableOutputDescriptorZ *ret = MALLOC(sizeof(LDKCVec_SpendableOutputDescriptorZ), "LDKCVec_SpendableOutputDescriptorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVec_SpendableOutputDescriptorZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr); - arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) { LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1807,6 +1748,245 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } return ret; } +static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; +static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; +static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; +static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { + LDKPaymentPurpose_InvoicePayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;")); + CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); + LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[BJ)V"); + CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); + LDKPaymentPurpose_SpontaneousPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;")); + CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); + LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); + CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); + switch(obj->tag) { + case LDKPaymentPurpose_InvoicePayment: { + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); + int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); + return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id); + } + case LDKPaymentPurpose_SpontaneousPayment: { + int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); + return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); + } + default: abort(); + } +} +static jclass LDKEvent_FundingGenerationReady_class = NULL; +static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; +static jclass LDKEvent_PaymentReceived_class = NULL; +static jmethodID LDKEvent_PaymentReceived_meth = NULL; +static jclass LDKEvent_PaymentSent_class = NULL; +static jmethodID LDKEvent_PaymentSent_meth = NULL; +static jclass LDKEvent_PaymentPathFailed_class = NULL; +static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; +static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; +static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; +static jclass LDKEvent_SpendableOutputs_class = NULL; +static jmethodID LDKEvent_SpendableOutputs_meth = NULL; +static jclass LDKEvent_PaymentForwarded_class = NULL; +static jmethodID LDKEvent_PaymentForwarded_meth = NULL; +static jclass LDKEvent_ChannelClosed_class = NULL; +static jmethodID LDKEvent_ChannelClosed_meth = NULL; +static jclass LDKEvent_DiscardFunding_class = NULL; +static jmethodID LDKEvent_DiscardFunding_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { + LDKEvent_FundingGenerationReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); + CHECK(LDKEvent_FundingGenerationReady_class != NULL); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); + CHECK(LDKEvent_FundingGenerationReady_meth != NULL); + LDKEvent_PaymentReceived_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); + CHECK(LDKEvent_PaymentReceived_class != NULL); + LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([BJJ)V"); + CHECK(LDKEvent_PaymentReceived_meth != NULL); + LDKEvent_PaymentSent_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); + CHECK(LDKEvent_PaymentSent_class != NULL); + LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B[B[BJ)V"); + CHECK(LDKEvent_PaymentSent_meth != NULL); + LDKEvent_PaymentPathFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;")); + CHECK(LDKEvent_PaymentPathFailed_class != NULL); + LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); + CHECK(LDKEvent_PaymentPathFailed_meth != NULL); + LDKEvent_PendingHTLCsForwardable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); + CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); + LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); + CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); + LDKEvent_SpendableOutputs_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); + CHECK(LDKEvent_SpendableOutputs_class != NULL); + LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "([J)V"); + CHECK(LDKEvent_SpendableOutputs_meth != NULL); + LDKEvent_PaymentForwarded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;")); + CHECK(LDKEvent_PaymentForwarded_class != NULL); + LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JZ)V"); + CHECK(LDKEvent_PaymentForwarded_meth != NULL); + LDKEvent_ChannelClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;")); + CHECK(LDKEvent_ChannelClosed_class != NULL); + LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([BJJ)V"); + CHECK(LDKEvent_ChannelClosed_meth != NULL); + LDKEvent_DiscardFunding_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;")); + CHECK(LDKEvent_DiscardFunding_class != NULL); + LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "([B[B)V"); + CHECK(LDKEvent_DiscardFunding_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKEvent *obj = (LDKEvent*)(ptr & ~1); + switch(obj->tag) { + case LDKEvent_FundingGenerationReady: { + int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data); + LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; + int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen); + (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data); + return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_arr, obj->funding_generation_ready.user_channel_id); + } + case LDKEvent_PaymentReceived: { + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data); + uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref); + } + case LDKEvent_PaymentSent: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data); + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data); + uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref); + } + case LDKEvent_PaymentPathFailed: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data); + uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; + LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + uint64_t path_conv_10_ref = 0; + CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; + LDKRouteParameters retry_var = obj->payment_path_failed.retry; + uint64_t retry_ref = 0; + if ((uint64_t)retry_var.inner > 4096) { + CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var); + retry_ref = (uint64_t)retry_var.inner & ~1; + } + return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref); + } + case LDKEvent_PendingHTLCsForwardable: { + return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable); + } + case LDKEvent_SpendableOutputs: { + LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; + int64_tArray outputs_arr = NULL; + outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen); + int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL); + for (size_t b = 0; b < outputs_var.datalen; b++) { + uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; + outputs_arr_ptr[b] = outputs_conv_27_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0); + return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr); + } + case LDKEvent_PaymentForwarded: { + uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, obj->payment_forwarded.claim_from_onchain_tx); + } + case LDKEvent_ChannelClosed: { + int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data); + uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; + return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, obj->channel_closed.user_channel_id, reason_ref); + } + case LDKEvent_DiscardFunding: { + int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data); + LDKTransaction transaction_var = obj->discard_funding.transaction; + int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); + (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); + return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr); + } + default: abort(); + } +} +static jclass LDKCOption_EventZ_Some_class = NULL; +static jmethodID LDKCOption_EventZ_Some_meth = NULL; +static jclass LDKCOption_EventZ_None_class = NULL; +static jmethodID LDKCOption_EventZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) { + LDKCOption_EventZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$Some;")); + CHECK(LDKCOption_EventZ_Some_class != NULL); + LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_EventZ_Some_meth != NULL); + LDKCOption_EventZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$None;")); + CHECK(LDKCOption_EventZ_None_class != NULL); + LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "", "()V"); + CHECK(LDKCOption_EventZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_EventZ *obj = (LDKCOption_EventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_EventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_EventZ_Some_class, LDKCOption_EventZ_Some_meth, some_ref); + } + case LDKCOption_EventZ_None: { + return (*env)->NewObject(env, LDKCOption_EventZ_None_class, LDKCOption_EventZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} static jclass LDKErrorAction_DisconnectPeer_class = NULL; static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL; static jclass LDKErrorAction_IgnoreError_class = NULL; @@ -1846,6 +2026,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1 if ((uint64_t)msg_var.inner > 4096) { CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; } return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref); @@ -1862,6 +2043,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1 uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref); } @@ -2013,6 +2195,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref); } @@ -2023,6 +2206,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref); } @@ -2033,6 +2217,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref); } @@ -2043,6 +2228,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref); } @@ -2053,6 +2239,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref); } @@ -2063,6 +2250,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref); } @@ -2073,6 +2261,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t updates_ref = 0; CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var); updates_ref = (uint64_t)updates_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref); } @@ -2083,6 +2272,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref); } @@ -2093,6 +2283,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref); } @@ -2103,6 +2294,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref); } @@ -2113,6 +2305,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref); } @@ -2121,11 +2314,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; uint64_t update_msg_ref = 0; CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var); update_msg_ref = (uint64_t)update_msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref); } @@ -2134,6 +2329,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref); } @@ -2142,6 +2338,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref); } @@ -2152,6 +2349,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref); } @@ -2168,6 +2366,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref); } @@ -2178,6 +2377,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref); } @@ -2188,32 +2388,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_MessageSendEventZ *ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVec_MessageSendEventZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr); - arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) { LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2221,9 +2402,6 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InitFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2231,6 +2409,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2241,12 +2420,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2254,6 +2431,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2264,12 +2442,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2277,6 +2453,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeatures uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2287,12 +2464,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeatures uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2300,6 +2475,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeatures uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2310,12 +2486,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeatures uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2323,6 +2497,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParamete uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2333,12 +2508,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParamete uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2346,6 +2519,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2356,12 +2530,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2369,6 +2541,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentO uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2379,12 +2552,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentO uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2392,6 +2563,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOu uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2402,12 +2574,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOu uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2421,12 +2591,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutput uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneNoneZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneNoneZ *val = (LDKCResult_NoneNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2466,9 +2634,6 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2482,9 +2647,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1Signature CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignatureNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2594,6 +2756,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th holder_tx_var = HolderCommitmentTransaction_clone(holder_tx); CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); holder_tx_ref = (uint64_t)holder_tx_var.inner; if (holder_tx_var.is_owned) { holder_tx_ref |= 1; @@ -2608,7 +2771,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2652,6 +2815,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L commitment_tx_var = CommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -2666,7 +2830,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); - ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2693,7 +2857,7 @@ LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const vo void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2713,6 +2877,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -2727,7 +2892,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); - ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2758,7 +2923,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2784,6 +2949,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -2798,7 +2964,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2824,6 +2990,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -2838,7 +3005,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2858,6 +3025,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* closing_tx_var = ClosingTransaction_clone(closing_tx); CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var); closing_tx_ref = (uint64_t)closing_tx_var.inner; if (closing_tx_var.is_owned) { closing_tx_ref |= 1; @@ -2872,7 +3040,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2892,6 +3060,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void msg_var = UnsignedChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -2906,7 +3075,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2926,6 +3095,7 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); channel_parameters_ref = (uint64_t)channel_parameters_var.inner; if (channel_parameters_var.is_owned) { channel_parameters_ref |= 1; @@ -2978,7 +3148,7 @@ static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKBaseSign ret = { .this_arg = (void*) calls, @@ -3031,6 +3201,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1holder_ LDKHolderCommitmentTransaction holder_tx_conv; holder_tx_conv.inner = (void*)(holder_tx & (~1)); holder_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv); return (uint64_t)ret_conv; @@ -3052,6 +3223,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterpart LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -3077,6 +3249,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1com LDKHolderCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -3116,6 +3289,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1re LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_justice_revoked_htlc)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -3136,6 +3310,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterpart LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -3148,6 +3323,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1closing_1tr LDKClosingTransaction closing_tx_conv; closing_tx_conv.inner = (void*)(closing_tx & (~1)); closing_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv); return (uint64_t)ret_conv; @@ -3160,6 +3336,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1an LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -3172,6 +3349,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEn LDKChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv); } @@ -3188,6 +3366,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3262,7 +3441,7 @@ static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKSign ret = { .this_arg = (void*) calls, @@ -3296,9 +3475,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3313,12 +3489,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RecoverableSignatureNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RecoverableSignatureNoneZ *val = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3338,9 +3512,6 @@ static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *or } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_CVec_u8ZZNoneZ*)arg)->result_ok; -} JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3362,9 +3533,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNo CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InMemorySignerDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3372,6 +3540,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3382,29 +3551,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_TxOutZ *ret = MALLOC(sizeof(LDKCVec_TxOutZ), "LDKCVec_TxOutZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVec_TxOutZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr); - arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3412,9 +3562,6 @@ static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3447,6 +3594,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3454,26 +3602,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1BlockHashChannelMonitorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_BlockHashChannelMonitorZZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * ret->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) { LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3481,9 +3609,6 @@ static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashCh } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)arg)->result_ok; -} JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3609,15 +3734,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr uint64_t script_ref = 0; CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); script_ref = (uint64_t)script_var.inner & ~1; return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref); } default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3629,26 +3752,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1 uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CResult_1NoneAPIErrorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_CResult_NoneAPIErrorZZ *ret = MALLOC(sizeof(LDKCVec_CResult_NoneAPIErrorZZ), "LDKCVec_CResult_NoneAPIErrorZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * ret->datalen, "LDKCVec_CResult_NoneAPIErrorZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr); - arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) { LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3656,26 +3759,6 @@ static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(c } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1APIErrorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_APIErrorZ *ret = MALLOC(sizeof(LDKCVec_APIErrorZ), "LDKCVec_APIErrorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKAPIError) * ret->datalen, "LDKCVec_APIErrorZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr); - arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) { LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3683,9 +3766,6 @@ static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *or } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult__u832APIErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult__u832APIErrorZ *val = (LDKCResult__u832APIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3779,6 +3859,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ if ((uint64_t)failed_paths_retry_var.inner > 4096) { CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1; } int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -3788,9 +3869,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3804,9 +3882,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymen uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3838,9 +3913,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPay return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3911,26 +3983,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1p default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_NetAddressZ *ret = MALLOC(sizeof(LDKCVec_NetAddressZ), "LDKCVec_NetAddressZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVec_NetAddressZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr); - arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3958,9 +4010,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPay return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentSecretAPIErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3974,26 +4023,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAP uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_ChannelMonitorZ *ret = MALLOC(sizeof(LDKCVec_ChannelMonitorZ), "LDKCVec_ChannelMonitorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVec_ChannelMonitorZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKChannelMonitor arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelMonitor_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) { LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4039,6 +4068,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -4047,6 +4077,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t monitor_ref = 0; CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = (uint64_t)monitor_var.inner; if (monitor_var.is_owned) { monitor_ref |= 1; @@ -4061,7 +4092,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4080,6 +4111,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -4088,6 +4120,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t update_ref = 0; CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -4102,7 +4135,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4136,7 +4169,7 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1); CHECK_ACCESS(ret_conv_14_ptr); LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr); - ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1)); + FREE((void*)ret_conv_14); ret_constr.data[o] = ret_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -4184,10 +4217,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEn LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitor monitor_conv; monitor_conv.inner = (void*)(monitor & (~1)); monitor_conv.is_owned = (monitor & 1) || (monitor == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); monitor_conv = ChannelMonitor_clone(&monitor_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); @@ -4201,10 +4236,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIE LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = (update & 1) || (update == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); update_conv = ChannelMonitorUpdate_clone(&update_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); @@ -4412,7 +4449,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t LDKShutdownScript ret_conv; ret_conv.inner = (void*)(ret & (~1)); ret_conv.is_owned = (ret & 1) || (ret == 0); - ret_conv = ShutdownScript_clone(&ret_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4437,7 +4474,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKSign ret_conv = *(LDKSign*)(ret_ptr); - ret_conv = Sign_clone(&ret_conv); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4489,7 +4526,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr); - ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4518,7 +4555,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); - ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4596,6 +4633,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdow uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4750,7 +4788,7 @@ static void LDKLogger_JCalls_free(void* this_arg) { FREE(j_calls); } } -void log_LDKLogger_jcall(const void* this_arg, const char* record) { +void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -4759,11 +4797,19 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) { } else { DO_ASSERT(get_jenv_res == JNI_OK); } - const char* record_str = record; - jstring record_conv = str_ref_to_java(env, record_str, strlen(record_str)); + LDKRecord record_var = *record; + uint64_t record_ref = 0; + record_var = Record_clone(record); + CHECK((((uint64_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); + record_ref = (uint64_t)record_var.inner; + if (record_var.is_owned) { + record_ref |= 1; + } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_conv); + (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception."); @@ -4783,7 +4829,7 @@ static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) { atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V"); + calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V"); CHECK(calls->log_meth != NULL); LDKLogger ret = { @@ -4817,13 +4863,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner & ~1; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4838,12 +4882,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockH uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4851,6 +4893,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4861,12 +4904,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_OutPointDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4874,6 +4915,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4884,6 +4926,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5072,9 +5115,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1fro default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_COption_TypeZDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5088,6 +5128,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5127,6 +5168,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_ uint64_t routing_ref = 0; CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var); routing_ref = (uint64_t)routing_var.inner & ~1; return (*env)->NewObject(env, LDKPaymentError_Routing_class, LDKPaymentError_Routing_meth, routing_ref); } @@ -5137,9 +5179,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_ default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5153,9 +5192,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymen uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SiPrefixNoneZ*)arg)->result_ok; -} JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SiPrefixNoneZ *val = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5167,9 +5203,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5177,6 +5210,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1g uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5185,9 +5219,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_ CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignedRawInvoiceNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5195,6 +5226,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoic uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5212,6 +5244,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5238,6 +5271,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5245,9 +5279,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PayeePubKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5255,6 +5286,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5264,26 +5296,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyError jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1PrivateRouteZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_PrivateRouteZ *ret = MALLOC(sizeof(LDKCVec_PrivateRouteZ), "LDKCVec_PrivateRouteZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKPrivateRoute) * ret->datalen, "LDKCVec_PrivateRouteZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKPrivateRoute arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = PrivateRoute_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5291,9 +5303,6 @@ static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_Priva } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PositiveTimestampCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5301,6 +5310,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimesta uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5310,9 +5320,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestam jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneSemanticErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneSemanticErrorZ *val = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5324,9 +5331,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErro jclass err_conv = LDKSemanticError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceSemanticErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5334,6 +5338,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemantic uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5343,9 +5348,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticE jclass err_conv = LDKSemanticError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DescriptionCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5353,6 +5355,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCrea uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5362,9 +5365,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreat jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ExpiryTimeCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5372,6 +5372,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreat uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5381,9 +5382,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreati jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PrivateRouteCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5391,6 +5389,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCre uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5400,9 +5399,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCrea jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_StringErrorZ*)arg)->result_ok; -} JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_StringErrorZ *val = (LDKCResult_StringErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5416,9 +5412,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1ge jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5426,6 +5419,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorU uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5436,11 +5430,55 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorU uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HTLCUpdateDecodeErrorZ*)arg)->result_ok; +static jclass LDKCOption_MonitorEventZ_Some_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL; +static jclass LDKCOption_MonitorEventZ_None_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some;")); + CHECK(LDKCOption_MonitorEventZ_Some_class != NULL); + LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL); + LDKCOption_MonitorEventZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$None;")); + CHECK(LDKCOption_MonitorEventZ_None_class != NULL); + LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "", "()V"); + CHECK(LDKCOption_MonitorEventZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_MonitorEventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref); + } + case LDKCOption_MonitorEventZ_None: { + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); @@ -5449,6 +5487,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5459,12 +5498,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5477,6 +5514,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpda uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5489,6 +5527,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1g uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5529,26 +5568,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1ge return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32ScriptZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_u32ScriptZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32ScriptZZ), "LDKCVec_C2Tuple_u32ScriptZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * ret->datalen, "LDKCVec_C2Tuple_u32ScriptZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5585,26 +5604,6 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2T return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5612,299 +5611,6 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV } return ret; } -static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; -static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; -static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; -static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { - LDKPaymentPurpose_InvoicePayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;")); - CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); - LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[BJ)V"); - CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); - LDKPaymentPurpose_SpontaneousPayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;")); - CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); - LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); - CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); - switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: { - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); - int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); - return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id); - } - case LDKPaymentPurpose_SpontaneousPayment: { - int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); - return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); - } - default: abort(); - } -} -static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL; -static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL; -static jclass LDKClosureReason_HolderForceClosed_class = NULL; -static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL; -static jclass LDKClosureReason_CooperativeClosure_class = NULL; -static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL; -static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL; -static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL; -static jclass LDKClosureReason_ProcessingError_class = NULL; -static jmethodID LDKClosureReason_ProcessingError_meth = NULL; -static jclass LDKClosureReason_DisconnectedPeer_class = NULL; -static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL; -static jclass LDKClosureReason_OutdatedChannelManager_class = NULL; -static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) { - LDKClosureReason_CounterpartyForceClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;")); - CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL); - LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL); - LDKClosureReason_HolderForceClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;")); - CHECK(LDKClosureReason_HolderForceClosed_class != NULL); - LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "()V"); - CHECK(LDKClosureReason_HolderForceClosed_meth != NULL); - LDKClosureReason_CooperativeClosure_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;")); - CHECK(LDKClosureReason_CooperativeClosure_class != NULL); - LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "", "()V"); - CHECK(LDKClosureReason_CooperativeClosure_meth != NULL); - LDKClosureReason_CommitmentTxConfirmed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;")); - CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL); - LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "", "()V"); - CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL); - LDKClosureReason_ProcessingError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;")); - CHECK(LDKClosureReason_ProcessingError_class != NULL); - LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKClosureReason_ProcessingError_meth != NULL); - LDKClosureReason_DisconnectedPeer_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;")); - CHECK(LDKClosureReason_DisconnectedPeer_class != NULL); - LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "", "()V"); - CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL); - LDKClosureReason_OutdatedChannelManager_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;")); - CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL); - LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "", "()V"); - CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); - switch(obj->tag) { - case LDKClosureReason_CounterpartyForceClosed: { - LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; - jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len); - return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv); - } - case LDKClosureReason_HolderForceClosed: { - return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth); - } - case LDKClosureReason_CooperativeClosure: { - return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth); - } - case LDKClosureReason_CommitmentTxConfirmed: { - return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth); - } - case LDKClosureReason_ProcessingError: { - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv); - } - case LDKClosureReason_DisconnectedPeer: { - return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth); - } - case LDKClosureReason_OutdatedChannelManager: { - return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth); - } - default: abort(); - } -} -static jclass LDKEvent_FundingGenerationReady_class = NULL; -static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; -static jclass LDKEvent_PaymentReceived_class = NULL; -static jmethodID LDKEvent_PaymentReceived_meth = NULL; -static jclass LDKEvent_PaymentSent_class = NULL; -static jmethodID LDKEvent_PaymentSent_meth = NULL; -static jclass LDKEvent_PaymentPathFailed_class = NULL; -static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; -static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; -static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; -static jclass LDKEvent_SpendableOutputs_class = NULL; -static jmethodID LDKEvent_SpendableOutputs_meth = NULL; -static jclass LDKEvent_PaymentForwarded_class = NULL; -static jmethodID LDKEvent_PaymentForwarded_meth = NULL; -static jclass LDKEvent_ChannelClosed_class = NULL; -static jmethodID LDKEvent_ChannelClosed_meth = NULL; -static jclass LDKEvent_DiscardFunding_class = NULL; -static jmethodID LDKEvent_DiscardFunding_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { - LDKEvent_FundingGenerationReady_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); - CHECK(LDKEvent_FundingGenerationReady_class != NULL); - LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); - CHECK(LDKEvent_FundingGenerationReady_meth != NULL); - LDKEvent_PaymentReceived_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); - CHECK(LDKEvent_PaymentReceived_class != NULL); - LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([BJJ)V"); - CHECK(LDKEvent_PaymentReceived_meth != NULL); - LDKEvent_PaymentSent_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); - CHECK(LDKEvent_PaymentSent_class != NULL); - LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B[B[BJ)V"); - CHECK(LDKEvent_PaymentSent_meth != NULL); - LDKEvent_PaymentPathFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;")); - CHECK(LDKEvent_PaymentPathFailed_class != NULL); - LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); - CHECK(LDKEvent_PaymentPathFailed_meth != NULL); - LDKEvent_PendingHTLCsForwardable_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); - CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); - LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); - CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); - LDKEvent_SpendableOutputs_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); - CHECK(LDKEvent_SpendableOutputs_class != NULL); - LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "([J)V"); - CHECK(LDKEvent_SpendableOutputs_meth != NULL); - LDKEvent_PaymentForwarded_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;")); - CHECK(LDKEvent_PaymentForwarded_class != NULL); - LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JZ)V"); - CHECK(LDKEvent_PaymentForwarded_meth != NULL); - LDKEvent_ChannelClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;")); - CHECK(LDKEvent_ChannelClosed_class != NULL); - LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([BJJ)V"); - CHECK(LDKEvent_ChannelClosed_meth != NULL); - LDKEvent_DiscardFunding_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;")); - CHECK(LDKEvent_DiscardFunding_class != NULL); - LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "([B[B)V"); - CHECK(LDKEvent_DiscardFunding_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKEvent *obj = (LDKEvent*)(ptr & ~1); - switch(obj->tag) { - case LDKEvent_FundingGenerationReady: { - int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data); - LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; - int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen); - (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data); - return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_arr, obj->funding_generation_ready.user_channel_id); - } - case LDKEvent_PaymentReceived: { - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data); - uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref); - } - case LDKEvent_PaymentSent: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data); - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data); - uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref); - } - case LDKEvent_PaymentPathFailed: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data); - uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; - LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; - LDKRouteParameters retry_var = obj->payment_path_failed.retry; - uint64_t retry_ref = 0; - if ((uint64_t)retry_var.inner > 4096) { - CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - retry_ref = (uint64_t)retry_var.inner & ~1; - } - return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref); - } - case LDKEvent_PendingHTLCsForwardable: { - return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable); - } - case LDKEvent_SpendableOutputs: { - LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; - int64_tArray outputs_arr = NULL; - outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen); - int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL); - for (size_t b = 0; b < outputs_var.datalen; b++) { - uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; - outputs_arr_ptr[b] = outputs_conv_27_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0); - return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr); - } - case LDKEvent_PaymentForwarded: { - uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, obj->payment_forwarded.claim_from_onchain_tx); - } - case LDKEvent_ChannelClosed: { - int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data); - uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; - return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, obj->channel_closed.user_channel_id, reason_ref); - } - case LDKEvent_DiscardFunding: { - int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); - (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); - return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr); - } - default: abort(); - } -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_EventZ *ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVec_EventZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr); - arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5931,26 +5637,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b( return (uint64_t)ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_u32TxOutZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32TxOutZZ), "LDKCVec_C2Tuple_u32TxOutZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * ret->datalen, "LDKCVec_C2Tuple_u32TxOutZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) { LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5987,26 +5673,6 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2T return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6062,26 +5728,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr( default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1BalanceZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_BalanceZ *ret = MALLOC(sizeof(LDKCVec_BalanceZ), "LDKCVec_BalanceZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKBalance) * ret->datalen, "LDKCVec_BalanceZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr); - arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) { LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6089,9 +5735,6 @@ static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6107,12 +5750,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockH uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneLightningErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6125,6 +5766,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6148,26 +5790,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1ge return (uint64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1PublicKeyTypeZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_PublicKeyTypeZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_PublicKeyTypeZZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * ret->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) { LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6175,9 +5797,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok; -} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6190,6 +5809,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6202,6 +5822,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6218,6 +5839,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6234,6 +5856,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6241,26 +5864,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * ret->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr); - arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6268,26 +5871,6 @@ static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CV } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_NodeAnnouncementZ *ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVec_NodeAnnouncementZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKNodeAnnouncement arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = NodeAnnouncement_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6295,9 +5878,6 @@ static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCV } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6313,12 +5893,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHa uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6331,12 +5909,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6349,12 +5925,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeIdDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6362,6 +5936,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6372,6 +5947,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6419,7 +6012,7 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); - ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6499,9 +6092,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1f default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DirectionalChannelInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6509,6 +6099,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6519,12 +6110,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6532,6 +6121,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6542,12 +6132,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RoutingFeesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6555,6 +6143,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6565,12 +6154,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6578,6 +6165,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6588,32 +6176,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_u64Z *ret = MALLOC(sizeof(LDKCVec_u64Z), "LDKCVec_u64Z"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVec_u64Z Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6621,6 +6192,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6631,12 +6203,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NetworkGraphDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6644,6 +6214,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6654,6 +6225,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6694,9 +6266,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddres default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6710,29 +6279,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateAddHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateAddHTLCZ), "LDKCVec_UpdateAddHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVec_UpdateAddHTLCZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKUpdateAddHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateAddHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) { LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6740,26 +6290,6 @@ static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_Upd } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFulfillHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFulfillHTLCZ), "LDKCVec_UpdateFulfillHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVec_UpdateFulfillHTLCZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKUpdateFulfillHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFulfillHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) { LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6767,26 +6297,6 @@ static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDK } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFailHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailHTLCZ), "LDKCVec_UpdateFailHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVec_UpdateFailHTLCZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKUpdateFailHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) { LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6794,26 +6304,6 @@ static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_U } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFailMalformedHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailMalformedHTLCZ), "LDKCVec_UpdateFailMalformedHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVec_UpdateFailMalformedHTLCZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKUpdateFailMalformedHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailMalformedHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) { LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6821,9 +6311,6 @@ static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clo } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_AcceptChannelDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6831,6 +6318,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6841,12 +6329,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_AnnouncementSignaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6854,6 +6340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSig uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6864,12 +6351,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSig uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelReestablishDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6877,6 +6362,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestabl uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6887,12 +6373,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestabl uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ClosingSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6900,6 +6384,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6910,12 +6395,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6923,6 +6406,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6933,12 +6417,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CommitmentSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6946,6 +6428,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSigne uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6956,12 +6439,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSigne uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingCreatedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6969,6 +6450,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6979,12 +6461,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6992,6 +6472,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7002,12 +6483,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingLockedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7015,6 +6494,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7025,12 +6505,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InitDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7038,6 +6516,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7048,12 +6527,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_OpenChannelDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7061,6 +6538,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7071,12 +6549,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RevokeAndACKDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7084,6 +6560,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7094,12 +6571,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7107,6 +6582,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7117,12 +6593,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFailHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7130,6 +6604,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7140,12 +6615,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7153,6 +6626,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalfo uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7163,12 +6637,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalfo uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFeeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7176,6 +6648,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7186,12 +6659,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7199,6 +6670,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHT uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7209,12 +6681,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHT uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateAddHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7222,6 +6692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7232,12 +6703,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PingDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7245,6 +6714,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7255,12 +6725,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PongDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7268,6 +6736,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7278,12 +6747,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7291,6 +6758,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7301,12 +6769,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7314,6 +6780,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounce uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7324,12 +6791,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounce uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7337,6 +6802,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7347,12 +6813,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7360,6 +6824,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7370,12 +6835,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ErrorMessageDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7383,6 +6846,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7393,12 +6857,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7406,6 +6868,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnn uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7416,12 +6879,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnn uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7429,6 +6890,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7439,12 +6901,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7452,6 +6912,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChann uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7462,12 +6923,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChann uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7475,6 +6934,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChann uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7485,12 +6945,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChann uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_QueryChannelRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7498,6 +6956,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7508,12 +6967,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7521,6 +6978,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7531,12 +6989,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7544,6 +7000,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestamp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7554,6 +7011,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestamp uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -7586,9 +7044,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceSignOrCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7596,6 +7051,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7667,6 +7123,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void uint64_t output_ref = 0; CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = (uint64_t)output_var.inner; if (output_var.is_owned) { output_ref |= 1; @@ -7681,7 +7138,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr); - ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7738,6 +7195,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JN LDKWatchedOutput output_conv; output_conv.inner = (void*)(output & (~1)); output_conv.is_owned = (output & 1) || (output == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv); output_conv = WatchedOutput_clone(&output_conv); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); @@ -7780,9 +7238,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1f default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_LockedChannelMonitorNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -7790,6 +7245,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMo uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7798,26 +7254,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonit CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1OutPointZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_OutPointZ *ret = MALLOC(sizeof(LDKCVec_OutPointZ), "LDKCVec_OutPointZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKOutPoint) * ret->datalen, "LDKCVec_OutPointZ Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - int64_t arr_elem = java_elems[i]; - LDKOutPoint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = OutPoint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) { LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -7876,7 +7312,7 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1); CHECK_ACCESS(ret_conv_18_ptr); LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr); - ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1)); + FREE((void*)ret_conv_18); ret_constr.data[s] = ret_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -8490,6 +7926,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -8499,6 +7936,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -8507,6 +7945,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -8521,7 +7960,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8540,6 +7979,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -8550,6 +7990,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal update_var = ChannelMonitorUpdate_clone(update); CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -8560,6 +8001,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -8568,6 +8010,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -8582,7 +8025,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8624,13 +8067,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1chan LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv); @@ -8644,16 +8090,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_ LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv); @@ -8718,6 +8168,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8727,6 +8178,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = OpenChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8757,6 +8209,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8766,6 +8219,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = AcceptChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8797,6 +8251,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingCreated_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8828,6 +8283,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8859,6 +8315,7 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingLocked_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8890,6 +8347,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub their_features_var = InitFeatures_clone(their_features); CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8899,6 +8357,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = Shutdown_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8930,6 +8389,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ClosingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8961,6 +8421,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8992,6 +8453,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9023,6 +8485,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9054,6 +8517,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9085,6 +8549,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9116,6 +8581,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9147,6 +8613,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9178,6 +8645,7 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9231,6 +8699,7 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl msg_var = Init_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9262,6 +8731,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9293,6 +8763,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9324,6 +8795,7 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9441,10 +8913,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -9458,10 +8932,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -9475,6 +8951,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9488,6 +8965,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9501,6 +8979,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9514,9 +8993,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv); } @@ -9530,6 +9011,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9543,6 +9025,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateAddHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9556,6 +9039,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFulfillHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9569,6 +9053,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFailHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9582,6 +9067,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFailMalformedHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9595,6 +9081,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKCommitmentSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9608,6 +9095,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9621,6 +9109,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFee msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9634,6 +9123,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9657,6 +9147,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1c LDKInit msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9670,6 +9161,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9683,6 +9175,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9696,6 +9189,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9746,6 +9240,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_var = NodeAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9760,7 +9255,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9780,6 +9275,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_var = ChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9794,7 +9290,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9814,6 +9310,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9828,7 +9325,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9862,7 +9359,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1); CHECK_ACCESS(ret_conv_59_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr); - ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1)); + FREE((void*)ret_conv_59); ret_constr.data[h] = ret_conv_59_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -9901,7 +9398,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j LDKNodeAnnouncement ret_conv_18_conv; ret_conv_18_conv.inner = (void*)(ret_conv_18 & (~1)); ret_conv_18_conv.is_owned = (ret_conv_18 & 1) || (ret_conv_18 == 0); - ret_conv_18_conv = NodeAnnouncement_clone(&ret_conv_18_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv); ret_constr.data[s] = ret_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -9926,6 +9423,7 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK init_var = Init_clone(init); CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = (uint64_t)init_var.inner; if (init_var.is_owned) { init_ref |= 1; @@ -9956,6 +9454,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9970,7 +9469,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9991,6 +9490,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10005,7 +9505,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10026,6 +9526,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10040,7 +9541,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10061,6 +9562,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10075,7 +9577,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10150,6 +9652,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10162,6 +9665,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10174,6 +9678,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10213,6 +9718,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_ uint64_t ret_conv_18_ref = 0; CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var); ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner; if (ret_conv_18_var.is_owned) { ret_conv_18_ref |= 1; @@ -10234,6 +9740,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1r LDKInit init_conv; init_conv.inner = (void*)(init & (~1)); init_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv); (this_arg_conv->sync_routing_table)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); } @@ -10247,6 +9754,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10263,6 +9771,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKReplyShortChannelIdsEnd msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10279,6 +9788,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10295,6 +9805,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10346,7 +9857,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); - ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10439,7 +9950,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10473,7 +9984,7 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1); CHECK_ACCESS(ret_conv_25_ptr); LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr); - ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1)); + FREE((void*)ret_conv_25); ret_constr.data[z] = ret_conv_25_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -10773,6 +10284,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor source_var = NodeId_clone(source); CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); source_ref = (uint64_t)source_var.inner; if (source_var.is_owned) { source_ref |= 1; @@ -10782,6 +10294,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor target_var = NodeId_clone(target); CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); target_ref = (uint64_t)target_var.inner; if (target_var.is_owned) { target_ref |= 1; @@ -10816,6 +10329,7 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t path_conv_10_ref = 0; CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); path_conv_10_ref = (uint64_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; @@ -10899,9 +10413,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1ms LDKNodeId source_conv; source_conv.inner = (void*)(source & (~1)); source_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); LDKNodeId target_conv; target_conv.inner = (void*)(target & (~1)); target_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv); return ret_val; } @@ -10922,6 +10438,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(J LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -10977,6 +10494,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi // Warning: we may need a move here but no clone is available for LDKChannelManager CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = (uint64_t)channel_manager_var.inner; if (channel_manager_var.is_owned) { channel_manager_ref |= 1; @@ -10991,7 +10509,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); - ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11030,6 +10548,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerPersister_1pe LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); return (uint64_t)ret_conv; @@ -11159,7 +10678,7 @@ LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { LDKChannelDetails ret_conv_16_conv; ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1)); ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0); - ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); ret_constr.data[q] = ret_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -11182,6 +10701,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -11200,7 +10720,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11220,6 +10740,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -11236,7 +10757,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11299,6 +10820,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNI uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -11317,6 +10839,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment(JNIEnv LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -11335,6 +10858,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEn LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); @@ -11382,6 +10906,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, params_var = RouteParameters_clone(params); CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); params_ref = (uint64_t)params_var.inner; if (params_var.is_owned) { params_ref |= 1; @@ -11397,6 +10922,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, uint64_t first_hops_conv_16_ref = 0; CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner; if (first_hops_conv_16_var.is_owned) { first_hops_conv_16_ref |= 1; @@ -11417,7 +10943,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); - ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11459,6 +10985,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -11473,6 +11000,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); @@ -11529,6 +11057,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclas TxOut_free(_res_conv); } +static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(arg); + return (uint64_t)ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxOut* arg_conv = (LDKTxOut*)(arg & ~1); + int64_t ret_val = TxOut_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); @@ -11557,6 +11096,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_SecretKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11582,6 +11127,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PublicKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11591,6 +11142,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free CResult_PublicKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)(orig & ~1); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); @@ -11602,6 +11164,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDeco LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); @@ -11612,12 +11175,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11627,6 +11197,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeE CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); @@ -11638,6 +11219,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD LDKChannelPublicKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelPublicKeys_clone(&o_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); @@ -11648,12 +11230,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11663,6 +11252,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDeco CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); @@ -11674,6 +11274,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErro LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); @@ -11687,6 +11288,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErro return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11696,6 +11303,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_ CResult_TxCreationKeysErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); @@ -11726,6 +11344,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *en COption_u32Z_free(_res_conv); } +static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)arg; + int64_t ret_val = COption_u32Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); @@ -11738,6 +11368,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommit LDKHTLCOutputInCommitment o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCOutputInCommitment_clone(&o_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); @@ -11748,12 +11379,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommit LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11763,6 +11401,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmen CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); @@ -11774,6 +11423,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChanne LDKCounterpartyChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -11784,12 +11434,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChanne LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11799,6 +11456,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTr CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); @@ -11810,6 +11478,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransaction LDKChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelTransactionParameters_clone(&o_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -11820,12 +11489,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransaction LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11835,6 +11511,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionPar CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); @@ -11863,6 +11550,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTr LDKHolderCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HolderCommitmentTransaction_clone(&o_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11873,12 +11561,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11888,6 +11583,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTrans CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); @@ -11899,6 +11605,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTra LDKBuiltCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = BuiltCommitmentTransaction_clone(&o_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11909,12 +11616,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTra LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11924,6 +11638,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransa CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); @@ -11935,6 +11660,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTran LDKTrustedClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedClosingTransaction LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); @@ -11947,6 +11673,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTran return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11960,6 +11692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransact LDKCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentTransaction_clone(&o_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11970,12 +11703,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransact LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11985,6 +11725,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); @@ -11996,6 +11747,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentT LDKTrustedCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedCommitmentTransaction LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); @@ -12008,6 +11760,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentT return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12042,6 +11800,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_SignatureZNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12051,6 +11815,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ CResult_CVec_SignatureZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)(orig & ~1); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); @@ -12062,6 +11837,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDeco LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); @@ -12072,12 +11848,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12087,6 +11870,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeE CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); @@ -12098,6 +11892,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); @@ -12108,12 +11903,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva LDKInvalidShutdownScript e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = InvalidShutdownScript_clone(&e_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12123,6 +11925,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalid CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); @@ -12143,6 +11956,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err(JN return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12152,6 +11971,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIE CResult_NoneErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)(orig & ~1); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); @@ -12163,6 +11993,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHop_clone(&o_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv); @@ -12173,12 +12004,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12188,6 +12026,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_ CResult_RouteHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); @@ -12208,6 +12057,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * LDKRouteHop _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12235,6 +12085,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(J LDKRouteHop _res_conv_12_conv_10_conv; _res_conv_12_conv_10_conv.inner = (void*)(_res_conv_12_conv_10 & (~1)); _res_conv_12_conv_10_conv.is_owned = (_res_conv_12_conv_10 & 1) || (_res_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv); _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res_conv_12, _res_conv_12_vals, 0); @@ -12247,6 +12098,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_ LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv); @@ -12257,12 +12109,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12272,6 +12131,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1fr CResult_RouteDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = CResult_RouteDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)(orig & ~1); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); @@ -12283,6 +12153,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDec LDKRouteParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteParameters_clone(&o_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv); @@ -12293,12 +12164,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12308,6 +12186,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecode CResult_RouteParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); @@ -12328,6 +12217,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv LDKRouteHint _res_conv_11_conv; _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1)); _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv); _res_constr.data[l] = _res_conv_11_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12357,6 +12247,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *en COption_u64Z_free(_res_conv); } +static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)arg; + int64_t ret_val = COption_u64Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); @@ -12369,6 +12271,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_ LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Payee_clone(&o_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv); @@ -12379,12 +12282,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PayeeDecodeErrorZ* o_conv = (LDKCResult_PayeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12394,6 +12304,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1fr CResult_PayeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); + *ret_conv = CResult_PayeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PayeeDecodeErrorZ* arg_conv = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); @@ -12414,6 +12335,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIE LDKRouteHintHop _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12424,6 +12346,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErr LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHint_clone(&o_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv); @@ -12434,12 +12357,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12449,6 +12379,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); @@ -12460,6 +12401,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHintHop_clone(&o_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv); @@ -12470,12 +12412,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12485,6 +12434,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErr CResult_RouteHintHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); @@ -12505,6 +12465,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JN LDKChannelDetails _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12515,6 +12476,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); @@ -12525,12 +12487,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12540,6 +12509,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_ CResult_RouteLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); @@ -12564,6 +12544,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxOutAccessErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12573,6 +12559,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1fr CResult_TxOutAccessErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); @@ -12580,6 +12577,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_ return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); + int64_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); @@ -12657,6 +12665,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitor return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); + jboolean ret_val = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12666,6 +12680,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpd CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); } +static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); + int64_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); @@ -12720,6 +12745,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransac COption_C2Tuple_usizeTransactionZZ_free(_res_conv); } +static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; + int64_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); @@ -12728,6 +12765,107 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTran return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); + o_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)o) & ~1)); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); + FREE((void*)_res); + COption_ClosureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)arg; + int64_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)orig; + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uint64_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -12755,6 +12893,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free( COption_NetworkUpdateZ_free(_res_conv); } +static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) { + LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); + *ret_copy = COption_NetworkUpdateZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)arg; + int64_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)orig; LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); @@ -12783,6 +12933,107 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescripto CVec_SpendableOutputDescriptorZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKEvent o_conv = *(LDKEvent*)(o_ptr); + o_conv = Event_clone((LDKEvent*)(((uint64_t)o) & ~1)); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); + FREE((void*)_res); + COption_EventZ_free(_res_conv); +} + +static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)arg; + int64_t ret_val = COption_EventZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)orig; + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_MessageSendEventZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -12807,6 +13058,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecode LDKInitFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InitFeatures_clone(&o_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); @@ -12817,12 +13069,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12836,6 +13095,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecode LDKNodeFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeFeatures_clone(&o_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); @@ -12846,12 +13106,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12865,6 +13132,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDec LDKChannelFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelFeatures_clone(&o_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); @@ -12875,12 +13143,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12894,6 +13169,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDec LDKInvoiceFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InvoiceFeatures_clone(&o_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); @@ -12904,12 +13180,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12923,6 +13206,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD LDKScoringParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); @@ -12933,12 +13217,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12952,6 +13243,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ LDKScorer o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScorer LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv); @@ -12962,12 +13254,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12981,6 +13280,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutp LDKDelayedPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -12991,12 +13291,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutp LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13006,6 +13313,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputD CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); @@ -13017,6 +13335,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu LDKStaticPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -13027,12 +13346,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13042,6 +13368,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDe CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); @@ -13063,12 +13400,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDes LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13078,6 +13422,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescri CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); @@ -13097,6 +13452,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNI return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)(o & ~1); + jboolean ret_val = CResult_NoneNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13106,6 +13467,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEn CResult_NoneNoneZ_free(_res_conv); } +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)(arg & ~1); + int64_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)(orig & ~1); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); @@ -13113,6 +13485,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(J return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); @@ -13167,6 +13550,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Signature return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13176,6 +13565,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVe CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); @@ -13198,6 +13598,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1er return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignatureNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13207,6 +13613,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free( CResult_SignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); @@ -13231,12 +13648,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SignDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13246,6 +13670,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1fre CResult_SignDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); @@ -13276,6 +13711,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatu return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13285,6 +13726,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureN CResult_RecoverableSignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); @@ -13336,6 +13788,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13345,6 +13803,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); @@ -13356,6 +13825,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDeco LDKInMemorySigner o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InMemorySigner_clone(&o_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); @@ -13366,12 +13836,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13381,6 +13858,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeE CResult_InMemorySignerDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); @@ -13425,6 +13913,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1 return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13434,6 +13928,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1fre CResult_TransactionNoneZ_free(_res_conv); } +static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); + int64_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); @@ -13441,6 +13946,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1 return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); + int64_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); @@ -13455,6 +13971,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo LDKChannelMonitor b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelMonitor_clone(&b_conv); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); @@ -13519,6 +14036,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1Blo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13528,6 +14051,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockH CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); @@ -13558,6 +14092,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *en COption_u16Z_free(_res_conv); } +static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; + int64_t ret_val = COption_u16Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); @@ -13582,6 +14128,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneAPIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13591,6 +14143,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(J CResult_NoneAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)(orig & ~1); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); @@ -13657,6 +14220,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); + jboolean ret_val = CResult__u832APIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13666,6 +14235,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free CResult__u832APIErrorZ_free(_res_conv); } +static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); + int64_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); @@ -13692,6 +14272,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSe return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13701,6 +14287,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendF CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); @@ -13724,6 +14321,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_NonePaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13733,6 +14336,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailur CResult_NonePaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)(orig & ~1); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); @@ -13740,6 +14354,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); @@ -13788,6 +14413,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHa return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13797,6 +14428,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashP CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); @@ -13824,6 +14466,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv CVec_NetAddressZ_free(_res_constr); } +static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); @@ -13871,6 +14524,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIEr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13880,6 +14539,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIError CResult_PaymentSecretAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); @@ -13900,6 +14570,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JN LDKChannelMonitor _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -13913,6 +14584,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa LDKChannelManager b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); // Warning: we need a move here but no clone is available for LDKChannelManager LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); @@ -13942,12 +14614,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13961,6 +14640,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod LDKChannelConfig o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelConfig_clone(&o_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); @@ -13971,12 +14651,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13986,6 +14673,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeEr CResult_ChannelConfigDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); @@ -13997,6 +14695,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErro LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OutPoint_clone(&o_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); @@ -14007,12 +14706,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OutPointDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14022,6 +14728,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_ CResult_OutPointDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); @@ -14059,6 +14776,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *e COption_TypeZ_free(_res_conv); } +static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; + int64_t ret_val = COption_TypeZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); @@ -14081,12 +14810,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14096,6 +14832,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeE CResult_COption_TypeZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); @@ -14122,6 +14869,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentEr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14131,6 +14884,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentError CResult_PaymentIdPaymentErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); @@ -14151,6 +14915,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1err return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SiPrefixNoneZ* o_conv = (LDKCResult_SiPrefixNoneZ*)(o & ~1); + jboolean ret_val = CResult_SiPrefixNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14160,6 +14930,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(J CResult_SiPrefixNoneZ_free(_res_conv); } +static inline uint64_t CResult_SiPrefixNoneZ_clone_ptr(LDKCResult_SiPrefixNoneZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); + *ret_conv = CResult_SiPrefixNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SiPrefixNoneZ* arg_conv = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SiPrefixNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SiPrefixNoneZ* orig_conv = (LDKCResult_SiPrefixNoneZ*)(orig & ~1); LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); @@ -14171,6 +14952,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1ok(J LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); *ret_conv = CResult_InvoiceNoneZ_ok(o_conv); @@ -14183,6 +14965,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1err( return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceNoneZ* o_conv = (LDKCResult_InvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14192,6 +14980,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JN CResult_InvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceNoneZ_clone_ptr(LDKCResult_InvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); + *ret_conv = CResult_InvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceNoneZ* arg_conv = (LDKCResult_InvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceNoneZ* orig_conv = (LDKCResult_InvoiceNoneZ*)(orig & ~1); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); @@ -14203,6 +15002,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = SignedRawInvoice_clone(&o_conv); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); *ret_conv = CResult_SignedRawInvoiceNoneZ_ok(o_conv); @@ -14215,6 +15015,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignedRawInvoiceNoneZ* o_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignedRawInvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14224,6 +15030,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignedRawInvoiceNoneZ_clone_ptr(LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); + *ret_conv = CResult_SignedRawInvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignedRawInvoiceNoneZ* arg_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignedRawInvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignedRawInvoiceNoneZ* orig_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(orig & ~1); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); @@ -14231,6 +15048,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); + int64_t ret_val = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); @@ -14242,6 +15070,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = RawInvoice_clone(&a_conv); LDKThirtyTwoBytes b_ref; CHECK((*env)->GetArrayLength(env, b) == 32); @@ -14249,6 +15078,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In LDKInvoiceSignature c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = InvoiceSignature_clone(&c_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); @@ -14268,6 +15098,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_ LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PayeePubKey_clone(&o_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); @@ -14281,6 +15112,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeePubKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14290,6 +15127,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1fr CResult_PayeePubKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); @@ -14310,6 +15158,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIE LDKPrivateRoute _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -14320,6 +15169,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampC LDKPositiveTimestamp o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PositiveTimestamp_clone(&o_conv); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); @@ -14333,6 +15183,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampC return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14342,6 +15198,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCrea CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); @@ -14362,6 +15229,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14371,6 +15244,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1f CResult_NoneSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); @@ -14382,6 +15266,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErr LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); @@ -14395,6 +15280,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14404,6 +15295,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); @@ -14415,6 +15317,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreatio LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Description_clone(&o_conv); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); @@ -14428,6 +15331,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreatio return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_DescriptionCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14437,6 +15346,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationEr CResult_DescriptionCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); @@ -14448,6 +15368,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreation LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ExpiryTime_clone(&o_conv); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); *ret_conv = CResult_ExpiryTimeCreationErrorZ_ok(o_conv); @@ -14461,6 +15382,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreation return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ExpiryTimeCreationErrorZ* o_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_ExpiryTimeCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14470,6 +15397,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErr CResult_ExpiryTimeCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_ExpiryTimeCreationErrorZ_clone_ptr(LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); + *ret_conv = CResult_ExpiryTimeCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ExpiryTimeCreationErrorZ* arg_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ExpiryTimeCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ExpiryTimeCreationErrorZ* orig_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(orig & ~1); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); @@ -14481,6 +15419,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreati LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PrivateRoute_clone(&o_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); @@ -14494,6 +15433,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreati return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14503,6 +15448,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationE CResult_PrivateRouteCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); @@ -14524,6 +15480,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err( return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); + jboolean ret_val = CResult_StringErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14537,6 +15499,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda LDKChannelMonitorUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelMonitorUpdate_clone(&o_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); @@ -14547,12 +15510,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14562,6 +15532,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateD CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); @@ -14569,10 +15550,112 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda return (uint64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)o) & ~1)); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); + FREE((void*)_res); + COption_MonitorEventZ_free(_res_conv); +} + +static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; + int64_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKHTLCUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCUpdate_clone(&o_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); @@ -14583,12 +15666,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14598,6 +15688,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeError CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); @@ -14615,12 +15716,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateE LDKMonitorUpdateError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = MonitorUpdateError_clone(&e_conv); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14630,6 +15738,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErro CResult_NoneMonitorUpdateErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); + *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); @@ -14637,6 +15756,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateE return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); @@ -14648,6 +15778,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1n LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKCVec_u8Z b_ref; b_ref.datalen = (*env)->GetArrayLength(env, b); @@ -14667,6 +15798,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free C2Tuple_OutPointScriptZ_free(_res_conv); } +static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); @@ -14713,6 +15855,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1fr CVec_C2Tuple_u32ScriptZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); @@ -14813,6 +15966,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEn CVec_TransactionZ_free(_res_constr); } +static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); @@ -14859,6 +16023,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1fre CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); @@ -14954,12 +16129,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14969,6 +16151,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashCha CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); @@ -14986,12 +16179,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningError LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15001,6 +16201,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1 CResult_NoneLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); @@ -15008,6 +16219,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningError return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); @@ -15070,12 +16292,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningError LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15085,6 +16314,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1 CResult_boolLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); @@ -15092,6 +16332,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningError return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); + int64_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); @@ -15103,14 +16354,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen LDKChannelAnnouncement a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = ChannelAnnouncement_clone(&a_conv); LDKChannelUpdate b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelUpdate_clone(&b_conv); LDKChannelUpdate c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = ChannelUpdate_clone(&c_conv); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); @@ -15159,6 +16413,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free( LDKNodeAnnouncement _res_conv_18_conv; _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); _res_constr.data[s] = _res_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15196,12 +16451,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandl LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15211,6 +16473,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleEr CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); @@ -15228,12 +16501,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErro LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_NonePeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15243,6 +16523,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_ CResult_NonePeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); @@ -15260,12 +16551,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErro LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15275,6 +16573,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_ CResult_boolPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); @@ -15286,6 +16595,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeId_clone(&o_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); @@ -15296,12 +16606,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15311,6 +16628,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1f CResult_NodeIdDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); @@ -15318,6 +16646,60 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ return (uint64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uint64_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -15352,6 +16734,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannel LDKDirectionalChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DirectionalChannelInfo_clone(&o_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_ok(o_conv); @@ -15362,12 +16745,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannel LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* o_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15377,6 +16767,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInf CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); + *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); @@ -15388,6 +16789,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeE LDKChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelInfo_clone(&o_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); @@ -15398,12 +16800,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15413,6 +16822,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErro CResult_ChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); @@ -15424,6 +16844,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeE LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RoutingFees_clone(&o_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); @@ -15434,12 +16855,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15449,6 +16877,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErro CResult_RoutingFeesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); @@ -15460,6 +16899,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementIn LDKNodeAnnouncementInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncementInfo_clone(&o_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); @@ -15470,12 +16910,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementIn LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15485,6 +16932,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoD CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); @@ -15512,6 +16970,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErro LDKNodeInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeInfo_clone(&o_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); @@ -15522,12 +16981,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15537,6 +17003,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_ CResult_NodeInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); @@ -15548,6 +17025,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecode LDKNetworkGraph o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NetworkGraph_clone(&o_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); @@ -15558,12 +17036,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15573,6 +17058,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErr CResult_NetworkGraphDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); @@ -15619,6 +17115,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1f COption_CVec_NetAddressZZ_free(_res_conv); } +static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; + int64_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); @@ -15641,12 +17149,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetAddressDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15656,6 +17171,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeError CResult_NetAddressDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); @@ -15676,6 +17202,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNI LDKUpdateAddHTLC _res_conv_15_conv; _res_conv_15_conv.inner = (void*)(_res_conv_15 & (~1)); _res_conv_15_conv.is_owned = (_res_conv_15 & 1) || (_res_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv); _res_constr.data[p] = _res_conv_15_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15695,6 +17222,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free LDKUpdateFulfillHTLC _res_conv_19_conv; _res_conv_19_conv.inner = (void*)(_res_conv_19 & (~1)); _res_conv_19_conv.is_owned = (_res_conv_19 & 1) || (_res_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); _res_constr.data[t] = _res_conv_19_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15714,6 +17242,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JN LDKUpdateFailHTLC _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15733,6 +17262,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ LDKUpdateFailMalformedHTLC _res_conv_25_conv; _res_conv_25_conv.inner = (void*)(_res_conv_25 & (~1)); _res_conv_25_conv.is_owned = (_res_conv_25 & 1) || (_res_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv); _res_constr.data[z] = _res_conv_25_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15743,6 +17273,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecod LDKAcceptChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AcceptChannel_clone(&o_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv); @@ -15753,12 +17284,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15768,6 +17306,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeEr CResult_AcceptChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(orig & ~1); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); @@ -15779,6 +17328,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignat LDKAnnouncementSignatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AnnouncementSignatures_clone(&o_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv); @@ -15789,12 +17339,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignat LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15804,6 +17361,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignature CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(orig & ~1); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); @@ -15815,6 +17383,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablish LDKChannelReestablish o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelReestablish_clone(&o_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); @@ -15825,12 +17394,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablish LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15840,6 +17416,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDec CResult_ChannelReestablishDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); @@ -15851,6 +17438,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecod LDKClosingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSigned_clone(&o_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv); @@ -15861,12 +17449,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15876,6 +17471,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeEr CResult_ClosingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); @@ -15887,6 +17493,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa LDKClosingSignedFeeRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSignedFeeRange_clone(&o_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv); @@ -15897,12 +17504,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15912,6 +17526,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); @@ -15923,6 +17548,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDe LDKCommitmentSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentSigned_clone(&o_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv); @@ -15933,12 +17559,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDe LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15948,6 +17581,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecod CResult_CommitmentSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); @@ -15959,6 +17603,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDeco LDKFundingCreated o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingCreated_clone(&o_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv); @@ -15969,12 +17614,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15984,6 +17636,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeE CResult_FundingCreatedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); @@ -15995,6 +17658,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod LDKFundingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingSigned_clone(&o_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); @@ -16005,12 +17669,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16020,6 +17691,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeEr CResult_FundingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); @@ -16031,6 +17713,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod LDKFundingLocked o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingLocked_clone(&o_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); @@ -16041,12 +17724,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingLockedDecodeErrorZ* o_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingLockedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16056,6 +17746,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeEr CResult_FundingLockedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); + *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); @@ -16067,6 +17768,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1 LDKInit o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Init_clone(&o_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); @@ -16077,12 +17779,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16092,6 +17801,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1fre CResult_InitDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)(orig & ~1); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); @@ -16103,6 +17823,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeE LDKOpenChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OpenChannel_clone(&o_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); @@ -16113,12 +17834,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16128,6 +17856,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErro CResult_OpenChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(orig & ~1); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); @@ -16139,6 +17878,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecode LDKRevokeAndACK o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RevokeAndACK_clone(&o_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); @@ -16149,12 +17889,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16164,6 +17911,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErr CResult_RevokeAndACKDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(orig & ~1); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); @@ -16175,6 +17933,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErro LDKShutdown o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Shutdown_clone(&o_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); @@ -16185,12 +17944,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16200,6 +17966,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_ CResult_ShutdownDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); @@ -16211,6 +17988,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDeco LDKUpdateFailHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailHTLC_clone(&o_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); @@ -16221,12 +17999,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16236,6 +18021,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeE CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); @@ -16247,6 +18043,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalforme LDKUpdateFailMalformedHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailMalformedHTLC_clone(&o_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv); @@ -16257,12 +18054,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalforme LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16272,6 +18076,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHT CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); @@ -16283,6 +18098,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErr LDKUpdateFee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFee_clone(&o_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv); @@ -16293,12 +18109,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16308,6 +18131,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); + *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); @@ -16319,6 +18153,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCD LDKUpdateFulfillHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFulfillHTLC_clone(&o_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv); @@ -16329,12 +18164,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16344,6 +18186,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDeco CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); @@ -16355,6 +18208,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecod LDKUpdateAddHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateAddHTLC_clone(&o_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv); @@ -16365,12 +18219,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16380,6 +18241,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeEr CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); @@ -16391,6 +18263,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1 LDKPing o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Ping_clone(&o_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv); @@ -16401,12 +18274,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PingDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16416,6 +18296,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1fre CResult_PingDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = CResult_PingDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)(orig & ~1); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); @@ -16427,6 +18318,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1 LDKPong o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Pong_clone(&o_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv); @@ -16437,12 +18329,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PongDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16452,6 +18351,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1fre CResult_PongDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = CResult_PongDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)(orig & ~1); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); @@ -16463,6 +18373,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnn LDKUnsignedChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelAnnouncement_clone(&o_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -16473,12 +18384,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnn LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16488,6 +18406,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnoun CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); @@ -16499,6 +18428,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncemen LDKChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelAnnouncement_clone(&o_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -16509,12 +18439,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncemen LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16524,6 +18461,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDe CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); @@ -16535,6 +18483,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpd LDKUnsignedChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelUpdate_clone(&o_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv); @@ -16545,12 +18494,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpd LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16560,6 +18516,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); @@ -16571,6 +18538,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecod LDKChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelUpdate_clone(&o_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv); @@ -16581,12 +18549,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16596,6 +18571,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeEr CResult_ChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); @@ -16607,6 +18593,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecode LDKErrorMessage o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ErrorMessage_clone(&o_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv); @@ -16617,12 +18604,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16632,6 +18626,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErr CResult_ErrorMessageDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(orig & ~1); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); @@ -16643,6 +18648,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnoun LDKUnsignedNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedNodeAnnouncement_clone(&o_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -16653,12 +18659,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnoun LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16668,6 +18681,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncem CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); @@ -16679,6 +18703,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDe LDKNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncement_clone(&o_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -16689,12 +18714,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDe LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16704,6 +18736,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecod CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); @@ -16715,6 +18758,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelI LDKQueryShortChannelIds o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryShortChannelIds_clone(&o_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv); @@ -16725,12 +18769,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelI LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16740,6 +18791,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsD CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(orig & ~1); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); @@ -16751,6 +18813,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelI LDKReplyShortChannelIdsEnd o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyShortChannelIdsEnd_clone(&o_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv); @@ -16761,12 +18824,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelI LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16776,6 +18846,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsE CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); @@ -16787,6 +18868,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeD LDKQueryChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryChannelRange_clone(&o_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv); @@ -16797,12 +18879,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16812,6 +18901,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDeco CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); @@ -16823,6 +18923,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeD LDKReplyChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyChannelRange_clone(&o_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv); @@ -16833,12 +18934,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16848,6 +18956,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDeco CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); @@ -16859,6 +18978,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil LDKGossipTimestampFilter o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = GossipTimestampFilter_clone(&o_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv); @@ -16869,12 +18989,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16884,6 +19011,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(orig & ~1); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); @@ -16895,6 +19033,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv); @@ -16911,6 +19050,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16920,6 +19065,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreation CResult_InvoiceSignOrCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(orig & ~1); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); @@ -16961,6 +19117,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonit LDKLockedChannelMonitor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKLockedChannelMonitor LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); @@ -16973,6 +19130,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonit return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)(o & ~1); + jboolean ret_val = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16995,6 +19158,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv * LDKOutPoint _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -17010,6 +19174,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *e PaymentPurpose_free(this_ptr_conv); } +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)arg; + int64_t ret_val = PaymentPurpose_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig; LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); @@ -17050,6 +19226,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *en ClosureReason_free(this_ptr_conv); } +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)arg; + int64_t ret_val = ClosureReason_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosureReason* orig_conv = (LDKClosureReason*)orig; LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); @@ -17118,6 +19306,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JN return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17127,6 +19325,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclas Event_free(this_ptr_conv); } +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKEvent* arg_conv = (LDKEvent*)arg; + int64_t ret_val = Event_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKEvent* orig_conv = (LDKEvent*)orig; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); @@ -17206,6 +19416,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -17217,6 +19428,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile LDKRouteParameters retry_conv; retry_conv.inner = (void*)(retry & (~1)); retry_conv.is_owned = (retry & 1) || (retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv); retry_conv = RouteParameters_clone(&retry_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv); @@ -17303,6 +19515,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *en return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17312,6 +19534,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv MessageSendEvent_free(this_ptr_conv); } +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)arg; + int64_t ret_val = MessageSendEvent_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig; LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); @@ -17327,6 +19561,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1acc LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AcceptChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); @@ -17341,6 +19576,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1ope LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = OpenChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); @@ -17355,6 +19591,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingCreated_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); @@ -17369,6 +19606,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); @@ -17383,6 +19621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingLocked_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); @@ -17397,6 +19636,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1ann LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AnnouncementSignatures_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); @@ -17411,6 +19651,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1h LDKCommitmentUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = (updates & 1) || (updates == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); updates_conv = CommitmentUpdate_clone(&updates_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); @@ -17425,6 +19666,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1rev LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = RevokeAndACK_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); @@ -17439,6 +19681,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1clo LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ClosingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); @@ -17453,6 +19696,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shu LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = Shutdown_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); @@ -17467,6 +19711,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelReestablish_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); @@ -17478,10 +19723,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelAnnouncement_clone(&msg_conv); LDKChannelUpdate update_msg_conv; update_msg_conv.inner = (void*)(update_msg & (~1)); update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); update_msg_conv = ChannelUpdate_clone(&update_msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); @@ -17493,6 +19740,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = NodeAnnouncement_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); @@ -17504,6 +19752,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); @@ -17518,6 +19767,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); @@ -17546,6 +19796,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); @@ -17560,6 +19811,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1sho LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); @@ -17574,6 +19826,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1rep LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); @@ -17617,6 +19870,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jc APIError_free(this_ptr_conv); } +static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)arg; + int64_t ret_val = APIError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAPIError* orig_conv = (LDKAPIError*)orig; LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); @@ -17668,6 +19933,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shu LDKShutdownScript script_conv; script_conv.inner = (void*)(script & (~1)); script_conv.is_owned = (script & 1) || (script == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); script_conv = ShutdownScript_clone(&script_conv); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_incompatible_shutdown_script(script_conv); @@ -17762,6 +20028,147 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jcla return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRecord this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Record_free(this_obj_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv)); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKLevel val_conv = LDKLevel_from_java(env, val); + Record_set_level(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_args(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_args(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_module_path(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_file(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_file(&this_ptr_conv, val_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_val = Record_get_line(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Record_set_line(&this_ptr_conv, val); +} + +static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRecord arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Record_clone_ptr(&arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecord orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKRecord ret_var = Record_clone(&orig_conv); + uint64_t ret_ref = 0; + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17775,6 +20182,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(J LDKChannelHandshakeConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeConfig_free(this_obj_conv); } @@ -17782,6 +20190,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -17790,6 +20199,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1m LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } @@ -17797,6 +20207,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); return ret_val; } @@ -17805,6 +20216,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); } @@ -17812,6 +20224,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -17820,6 +20233,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } @@ -17828,6 +20242,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17835,14 +20250,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new return ret_ref; } +static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelHandshakeConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17855,6 +20293,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1def uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17866,6 +20305,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(J LDKChannelHandshakeLimits this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeLimits_free(this_obj_conv); } @@ -17873,6 +20313,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -17881,6 +20322,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); } @@ -17888,6 +20330,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -17896,6 +20339,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); } @@ -17903,6 +20347,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -17911,6 +20356,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -17918,6 +20364,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -17926,6 +20373,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -17933,6 +20381,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -17941,6 +20390,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); } @@ -17948,6 +20398,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); return ret_val; } @@ -17956,6 +20407,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); } @@ -17963,6 +20415,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1ge LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); return ret_val; } @@ -17971,6 +20424,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1f LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); } @@ -17978,6 +20432,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); return ret_val; } @@ -17986,6 +20441,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1t LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); } @@ -17994,6 +20450,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18001,14 +20458,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new return ret_ref; } +static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeLimits arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelHandshakeLimits orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18021,6 +20501,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1def uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18032,6 +20513,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *en LDKChannelConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelConfig_free(this_obj_conv); } @@ -18039,6 +20521,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forward LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -18047,6 +20530,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); } @@ -18054,6 +20538,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forward LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -18062,6 +20547,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } @@ -18069,6 +20555,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1e LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -18077,6 +20564,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expi LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -18084,6 +20572,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_announced_channel(&this_ptr_conv); return ret_val; } @@ -18092,6 +20581,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_announced_channel(&this_ptr_conv, val); } @@ -18099,6 +20589,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); return ret_val; } @@ -18107,6 +20598,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1up LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } @@ -18114,6 +20606,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1du LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); return ret_val; } @@ -18122,6 +20615,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); } @@ -18129,6 +20623,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1 LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -18137,6 +20632,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1clo LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); } @@ -18145,6 +20641,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18152,14 +20649,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * return ret_ref; } +static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18172,6 +20692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18183,6 +20704,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JN LDKChannelConfig obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18204,6 +20726,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, LDKUserConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UserConfig_free(this_obj_conv); } @@ -18211,10 +20734,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1chann LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18226,9 +20751,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_ LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeConfig_clone(&val_conv); UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); } @@ -18237,10 +20764,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1chan LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18252,9 +20781,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeLimits_clone(&val_conv); UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); } @@ -18263,10 +20794,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1o LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18278,9 +20811,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1opti LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelConfig_clone(&val_conv); UserConfig_set_channel_options(&this_ptr_conv, val_conv); } @@ -18289,6 +20824,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1f LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); return ret_val; } @@ -18297,6 +20833,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwa LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); } @@ -18304,19 +20841,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env LDKChannelHandshakeConfig own_channel_config_arg_conv; own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); LDKChannelConfig channel_options_arg_conv; channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18324,14 +20865,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env return ret_ref; } +static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUserConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UserConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUserConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUserConfig ret_var = UserConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18344,6 +20908,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18355,17 +20920,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, j LDKBestBlock this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BestBlock_free(this_obj_conv); } +static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBestBlock arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BestBlock_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBestBlock orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBestBlock ret_var = BestBlock_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18379,6 +20968,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JN uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18394,6 +20984,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18405,6 +20996,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash( LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); return ret_arr; @@ -18414,6 +21006,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *e LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = BestBlock_height(&this_arg_conv); return ret_val; } @@ -18499,6 +21092,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *en LDKWatchedOutput this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); WatchedOutput_free(this_obj_conv); } @@ -18506,6 +21100,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1blo LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data); return ret_arr; @@ -18515,6 +21110,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1has LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -18525,10 +21121,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoin LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18540,9 +21138,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(J LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); } @@ -18551,6 +21151,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1scr LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18561,6 +21162,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pu LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -18575,6 +21177,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKCVec_u8Z script_pubkey_arg_ref; script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg); @@ -18584,6 +21187,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18591,14 +21195,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * return ret_ref; } +static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = WatchedOutput_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKWatchedOutput orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18610,6 +21237,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv LDKWatchedOutput o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = WatchedOutput_hash(&o_conv); return ret_val; } @@ -18664,17 +21292,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv * LDKMonitorUpdateId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateId_free(this_obj_conv); } +static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorUpdateId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorUpdateId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18686,6 +21338,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEn LDKMonitorUpdateId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MonitorUpdateId_hash(&o_conv); return ret_val; } @@ -18694,9 +21347,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv LDKMonitorUpdateId a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMonitorUpdateId b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv); return ret_val; } @@ -18714,6 +21369,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNI LDKLockedChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockedChannelMonitor_free(this_obj_conv); } @@ -18721,6 +21377,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env LDKChainMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainMonitor_free(this_obj_conv); } @@ -18768,6 +21425,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18779,6 +21437,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1cla LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ignored_channels_constr; ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels); if (ignored_channels_constr.datalen > 0) @@ -18791,6 +21450,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1cla LDKChannelDetails ignored_channels_conv_16_conv; ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; } @@ -18814,9 +21474,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor( LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); @@ -18827,6 +21489,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -18836,6 +21499,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo uint64_t ret_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner; if (ret_conv_10_var.is_owned) { ret_conv_10_ref |= 1; @@ -18851,13 +21515,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1moni LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorUpdateId completed_update_id_conv; completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); @@ -18868,6 +21535,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JN LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -18877,6 +21545,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(J LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -18886,6 +21555,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNI LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); return (uint64_t)ret_ret; @@ -18895,6 +21565,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsPro LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -18904,6 +21575,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNI LDKChannelMonitorUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitorUpdate_free(this_obj_conv); } @@ -18911,6 +21583,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1 LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); return ret_val; } @@ -18919,17 +21592,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1upd LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } +static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitorUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelMonitorUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18941,6 +21638,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1w LDKChannelMonitorUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18962,6 +21660,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEn LDKMonitorUpdateError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateError_free(this_obj_conv); } @@ -18969,6 +21668,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1get_1a( LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -18979,6 +21679,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1set_1a(JNI LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); MonitorUpdateError_set_a(&this_ptr_conv, val_conv); } @@ -18989,6 +21690,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNI uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18996,14 +21698,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNI return ret_ref; } +static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) { + LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorUpdateError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorUpdateError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19020,6 +21745,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env MonitorEvent_free(this_ptr_conv); } +static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; + int64_t ret_val = MonitorEvent_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); @@ -19032,6 +21769,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNI LDKHTLCUpdate a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = HTLCUpdate_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_htlcevent(a_conv); @@ -19043,6 +21781,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1t LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); @@ -19054,6 +21793,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1compl LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); @@ -19065,6 +21805,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1faile LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_failed(a_conv); @@ -19081,21 +21822,55 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNI return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKHTLCUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCUpdate_free(this_obj_conv); } +static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHTLCUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19107,6 +21882,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEn LDKHTLCUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19133,6 +21909,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jcl Balance_free(this_ptr_conv); } +static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBalance* arg_conv = (LDKBalance*)arg; + int64_t ret_val = Balance_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBalance* orig_conv = (LDKBalance*)orig; LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); @@ -19180,17 +21968,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *e LDKChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitor_free(this_obj_conv); } +static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelMonitor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19202,6 +22014,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(J LDKChannelMonitor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19213,9 +22026,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1mon LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMonitorUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; @@ -19234,6 +22049,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ChannelMonitor_get_latest_update_id(&this_arg_conv); return ret_val; } @@ -19242,6 +22058,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1fundin LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); return ((uint64_t)ret_conv); @@ -19251,6 +22068,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1o LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19269,6 +22087,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* filter_ptr = (void*)(((uint64_t)filter) & ~1); if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } LDKFilter* filter_conv = (LDKFilter*)filter_ptr; @@ -19279,6 +22098,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19298,6 +22118,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19317,6 +22138,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1l LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; @@ -19340,6 +22162,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19399,6 +22222,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconn LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19431,6 +22255,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transa LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19490,6 +22315,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1u LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char txid_arr[32]; CHECK((*env)->GetArrayLength(env, txid) == 32); (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); @@ -19522,6 +22348,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1 LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19565,6 +22392,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1r LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); @@ -19583,10 +22411,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1be LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19598,6 +22428,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1c LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19630,6 +22461,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jc LDKOutPoint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OutPoint_free(this_obj_conv); } @@ -19637,6 +22469,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNI LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv)); return ret_arr; @@ -19646,6 +22479,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *en LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -19656,6 +22490,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OutPoint_get_index(&this_ptr_conv); return ret_val; } @@ -19664,6 +22499,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *e LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OutPoint_set_index(&this_ptr_conv, val); } @@ -19675,6 +22511,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19682,14 +22519,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOutPoint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OutPoint_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKOutPoint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOutPoint ret_var = OutPoint_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19701,9 +22561,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKOutPoint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = OutPoint_eq(&a_conv, &b_conv); return ret_val; } @@ -19712,6 +22574,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = OutPoint_hash(&o_conv); return ret_val; } @@ -19720,6 +22583,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1 LDKOutPoint this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data); return ret_arr; @@ -19729,6 +22593,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv LDKOutPoint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19750,6 +22615,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DelayedPaymentOutputDescriptor_free(this_obj_conv); } @@ -19757,10 +22623,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19772,9 +22640,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -19783,6 +22653,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -19792,6 +22663,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -19802,6 +22674,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -19810,6 +22683,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } @@ -19817,6 +22691,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -19828,6 +22703,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -19837,6 +22713,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -19847,6 +22724,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); return ret_arr; @@ -19856,6 +22734,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -19866,6 +22745,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -19874,6 +22754,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -19881,6 +22762,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKPublicKey per_commitment_point_arg_ref; CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); @@ -19899,6 +22781,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19906,14 +22789,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip return ret_ref; } +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19925,6 +22831,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19946,6 +22853,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); StaticPaymentOutputDescriptor_free(this_obj_conv); } @@ -19953,10 +22861,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19968,9 +22878,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -19979,6 +22891,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -19990,6 +22903,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDesc LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); return ret_arr; @@ -19999,6 +22913,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -20009,6 +22924,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -20017,6 +22933,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -20024,6 +22941,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); @@ -20036,6 +22954,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20043,14 +22962,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript return ret_ref; } +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20062,6 +23004,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDesc LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -20088,6 +23031,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1fre SpendableOutputDescriptor_free(this_ptr_conv); } +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; + int64_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); @@ -20100,6 +23055,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKOutPoint outpoint_conv; outpoint_conv.inner = (void*)(outpoint & (~1)); outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); outpoint_conv = OutPoint_clone(&outpoint_conv); void* output_ptr = (void*)(((uint64_t)output) & ~1); CHECK_ACCESS(output_ptr); @@ -20115,6 +23071,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); @@ -20126,6 +23083,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); @@ -20161,6 +23119,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jc BaseSign_free(this_ptr_conv); } +static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSign* arg_conv = (LDKSign*)arg_ptr; + int64_t ret_val = Sign_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -20192,6 +23163,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *e LDKInMemorySigner this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InMemorySigner_free(this_obj_conv); } @@ -20199,6 +23171,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1fu LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); return ret_arr; @@ -20208,6 +23181,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20218,6 +23192,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1re LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); return ret_arr; @@ -20227,6 +23202,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocatio LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20237,6 +23213,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1pa LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); return ret_arr; @@ -20246,6 +23223,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20256,6 +23234,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1de LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); return ret_arr; @@ -20265,6 +23244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20275,6 +23255,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1ht LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); return ret_arr; @@ -20284,6 +23265,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1bas LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20294,6 +23276,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1co LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); return ret_arr; @@ -20303,20 +23286,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitmen LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInMemorySigner arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InMemorySigner_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInMemorySigner orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20350,6 +23357,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20361,10 +23369,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20376,6 +23386,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -20384,6 +23395,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1sel LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -20392,6 +23404,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbou LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InMemorySigner_is_outbound(&this_arg_conv); return ret_val; } @@ -20400,10 +23413,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1ou LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20415,10 +23430,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channe LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20430,6 +23447,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1count LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -20438,6 +23456,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1count LDKStaticPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -20447,6 +23466,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynam LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -20455,6 +23475,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynam LDKDelayedPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -20464,6 +23485,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSig LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); return (uint64_t)ret_ret; @@ -20473,6 +23495,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JN LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); return (uint64_t)ret_ret; @@ -20482,6 +23505,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(J LDKInMemorySigner obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -20503,6 +23527,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, LDKKeysManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); KeysManager_free(this_obj_conv); } @@ -20515,6 +23540,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *en uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20526,6 +23552,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channe LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char params_arr[32]; CHECK((*env)->GetArrayLength(env, params) == 32); (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); @@ -20534,6 +23561,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channe uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20545,6 +23573,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendab LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_SpendableOutputDescriptorZ descriptors_constr; descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); if (descriptors_constr.datalen > 0) @@ -20590,6 +23619,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterf LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); return (uint64_t)ret_ret; @@ -20599,6 +23629,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *e LDKChannelManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManager_free(this_obj_conv); } @@ -20606,6 +23637,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv * LDKChainParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainParameters_free(this_obj_conv); } @@ -20613,6 +23645,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1networ LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv)); return ret_conv; } @@ -20621,6 +23654,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network( LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNetwork val_conv = LDKNetwork_from_java(env, val); ChainParameters_set_network(&this_ptr_conv, val_conv); } @@ -20629,10 +23663,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_ LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20644,9 +23680,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1bl LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = BestBlock_clone(&val_conv); ChainParameters_set_best_block(&this_ptr_conv, val_conv); } @@ -20656,11 +23694,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv LDKBestBlock best_block_arg_conv; best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20668,14 +23708,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv return ret_ref; } +static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChainParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChainParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChainParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20687,6 +23750,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1fr LDKCounterpartyForwardingInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyForwardingInfo_free(this_obj_conv); } @@ -20694,6 +23758,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -20702,6 +23767,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); } @@ -20709,6 +23775,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -20717,6 +23784,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); } @@ -20724,6 +23792,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -20732,6 +23801,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -20740,6 +23810,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20747,14 +23818,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ return ret_ref; } +static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyForwardingInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCounterpartyForwardingInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20766,6 +23860,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIE LDKChannelCounterparty this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelCounterparty_free(this_obj_conv); } @@ -20773,6 +23868,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1ge LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -20782,6 +23878,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -20792,10 +23889,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1f LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20807,9 +23906,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1feat LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); ChannelCounterparty_set_features(&this_ptr_conv, val_conv); } @@ -20818,6 +23919,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1u LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); return ret_val; } @@ -20826,6 +23928,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unsp LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } @@ -20833,11 +23936,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1f LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20850,9 +23955,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forw LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyForwardingInfo_clone(&val_conv); ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } @@ -20864,15 +23971,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JN LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKCounterpartyForwardingInfo forwarding_info_arg_conv; forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20880,14 +23990,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JN return ret_ref; } +static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelCounterparty arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelCounterparty orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20899,6 +24032,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *e LDKChannelDetails this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelDetails_free(this_obj_conv); } @@ -20906,6 +24040,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1ch LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -20915,6 +24050,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -20925,10 +24061,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counte LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20940,9 +24078,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterpa LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelCounterparty_clone(&val_conv); ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } @@ -20951,11 +24091,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1fundin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20968,9 +24110,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } @@ -20979,6 +24123,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -20989,6 +24134,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1ch LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -21000,6 +24146,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channe LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -21008,6 +24155,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -21015,6 +24163,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspen LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21025,6 +24174,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendab LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -21036,6 +24186,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_user_channel_id(&this_ptr_conv); return ret_val; } @@ -21044,6 +24195,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1cha LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_user_channel_id(&this_ptr_conv, val); } @@ -21051,6 +24203,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbou LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -21059,6 +24212,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } @@ -21066,6 +24220,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inboun LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -21074,6 +24229,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } @@ -21081,6 +24237,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confir LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21091,6 +24248,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmat LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -21102,6 +24260,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21112,6 +24271,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1cl LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); @@ -21123,6 +24283,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1o LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_outbound(&this_ptr_conv); return ret_val; } @@ -21131,6 +24292,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbo LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_outbound(&this_ptr_conv, val); } @@ -21138,6 +24300,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1f LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_funding_locked(&this_ptr_conv); return ret_val; } @@ -21146,6 +24309,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1fundi LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_funding_locked(&this_ptr_conv, val); } @@ -21153,6 +24317,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1u LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_usable(&this_ptr_conv); return ret_val; } @@ -21161,6 +24326,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usabl LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_usable(&this_ptr_conv, val); } @@ -21168,6 +24334,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1p LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_public(&this_ptr_conv); return ret_val; } @@ -21176,6 +24343,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1publi LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_public(&this_ptr_conv, val); } @@ -21186,10 +24354,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv LDKChannelCounterparty counterparty_arg_conv; counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); LDKOutPoint funding_txo_arg_conv; funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1); CHECK_ACCESS(short_channel_id_arg_ptr); @@ -21210,6 +24380,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21217,14 +24388,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv return ret_ref; } +static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelDetails arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelDetails_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelDetails orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21241,6 +24435,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEn PaymentSendFailure_free(this_ptr_conv); } +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; + int64_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); @@ -21325,6 +24531,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial LDKRouteParameters failed_paths_retry_conv; failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); @@ -21374,15 +24581,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv LDKUserConfig config_conv; config_conv.inner = (void*)(config & (~1)); config_conv.is_owned = (config & 1) || (config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); config_conv = UserConfig_clone(&config_conv); LDKChainParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21394,10 +24604,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1curren LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21409,12 +24621,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1cha LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_network_key_ref; CHECK((*env)->GetArrayLength(env, their_network_key) == 33); (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form); LDKUserConfig override_config_conv; override_config_conv.inner = (void*)(override_config & (~1)); override_config_conv.is_owned = (override_config & 1) || (override_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); override_config_conv = UserConfig_clone(&override_config_conv); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); @@ -21425,6 +24639,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -21434,6 +24649,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -21449,6 +24665,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -21458,6 +24675,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -21473,6 +24691,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21486,6 +24705,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21499,6 +24719,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1clos LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21512,6 +24733,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_force_close_all_channels(&this_arg_conv); } @@ -21519,9 +24741,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -21537,9 +24761,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1paym LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); @@ -21552,9 +24778,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spont LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); @@ -21567,6 +24795,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tr LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char temporary_channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); @@ -21585,6 +24814,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1nod LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThreeBytes rgb_ref; CHECK((*env)->GetArrayLength(env, rgb) == 3); (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data); @@ -21613,6 +24843,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pendi LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } @@ -21620,6 +24851,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1o LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_timer_tick_occurred(&this_arg_conv); } @@ -21627,6 +24859,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); @@ -21639,6 +24872,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1fun LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); @@ -21650,6 +24884,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1ou LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form); return ret_arr; @@ -21659,6 +24894,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inb LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); @@ -21672,6 +24908,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inb LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -21688,6 +24925,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Message LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -21697,6 +24935,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsP LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -21706,6 +24945,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen( LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChannelManager_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -21715,6 +24955,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -21724,6 +24965,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1per LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); return ret_val; } @@ -21732,6 +24974,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persist LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_await_persistable_update(&this_arg_conv); } @@ -21739,10 +24982,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1be LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21754,6 +24999,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Channel LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -21763,6 +25009,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(J LDKChannelManager obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -21774,6 +25021,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(J LDKChannelManagerReadArgs this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManagerReadArgs_free(this_obj_conv); } @@ -21781,6 +25029,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; return ret_ret; @@ -21790,6 +25039,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1k LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); @@ -21804,6 +25054,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; return ret_ret; @@ -21813,6 +25064,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1f LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); @@ -21827,6 +25079,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; return ret_ret; @@ -21836,6 +25089,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1c LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKWatch val_conv = *(LDKWatch*)(val_ptr); @@ -21850,6 +25104,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; return ret_ret; @@ -21859,6 +25114,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1t LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); @@ -21873,6 +25129,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; return ret_ret; @@ -21882,6 +25139,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1l LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKLogger val_conv = *(LDKLogger*)(val_ptr); @@ -21896,10 +25154,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21911,9 +25171,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1d LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UserConfig_clone(&val_conv); ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } @@ -21957,6 +25219,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new LDKUserConfig default_config_conv; default_config_conv.inner = (void*)(default_config & (~1)); default_config_conv.is_owned = (default_config & 1) || (default_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); default_config_conv = UserConfig_clone(&default_config_conv); LDKCVec_ChannelMonitorZ channel_monitors_constr; channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors); @@ -21970,6 +25233,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new LDKChannelMonitor channel_monitors_conv_16_conv; channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); @@ -21977,6 +25241,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21991,6 +25256,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa LDKChannelManagerReadArgs arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = (arg & 1) || (arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); // Warning: we need a move here but no clone is available for LDKChannelManagerReadArgs LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); @@ -22002,17 +25268,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, LDKDecodeError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DecodeError_free(this_obj_conv); } +static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { + LDKDecodeError ret_var = DecodeError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDecodeError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DecodeError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDecodeError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDecodeError ret_var = DecodeError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22024,6 +25314,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass LDKInit this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Init_free(this_obj_conv); } @@ -22031,10 +25322,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22046,9 +25339,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *en LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); Init_set_features(&this_ptr_conv, val_conv); } @@ -22057,11 +25352,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKInit ret_var = Init_new(features_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22069,14 +25366,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { + LDKInit ret_var = Init_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInit arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Init_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInit orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInit ret_var = Init_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22088,6 +25408,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env LDKErrorMessage this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErrorMessage_free(this_obj_conv); } @@ -22095,6 +25416,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1chan LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -22104,6 +25426,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22114,6 +25437,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNI LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -22124,6 +25448,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); ErrorMessage_set_data(&this_ptr_conv, val_conv); } @@ -22137,6 +25462,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22144,14 +25470,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e return ret_ref; } +static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorMessage arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ErrorMessage_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKErrorMessage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22163,6 +25512,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass LDKPing this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Ping_free(this_obj_conv); } @@ -22170,6 +25520,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_ponglen(&this_ptr_conv); return ret_val; } @@ -22178,6 +25529,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_ponglen(&this_ptr_conv, val); } @@ -22185,6 +25537,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_byteslen(&this_ptr_conv); return ret_val; } @@ -22193,6 +25546,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *en LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_byteslen(&this_ptr_conv, val); } @@ -22201,6 +25555,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22208,14 +25563,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPing arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Ping_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPing orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPing ret_var = Ping_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22227,6 +25605,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass LDKPong this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Pong_free(this_obj_conv); } @@ -22234,6 +25613,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Pong_get_byteslen(&this_ptr_conv); return ret_val; } @@ -22242,6 +25622,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *en LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Pong_set_byteslen(&this_ptr_conv, val); } @@ -22250,6 +25631,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22257,14 +25639,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPong arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Pong_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPong orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPong ret_var = Pong_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22276,6 +25681,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, LDKOpenChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OpenChannel_free(this_obj_conv); } @@ -22283,6 +25689,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -22292,6 +25699,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash( LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22302,6 +25710,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1tempo LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22311,6 +25720,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1c LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22321,6 +25731,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -22329,6 +25740,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1sat LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_funding_satoshis(&this_ptr_conv, val); } @@ -22336,6 +25748,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msa LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_push_msat(&this_ptr_conv); return ret_val; } @@ -22344,6 +25757,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(J LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_push_msat(&this_ptr_conv, val); } @@ -22351,6 +25765,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1lim LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -22359,6 +25774,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -22366,6 +25782,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -22374,6 +25791,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1v LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -22381,6 +25799,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -22389,6 +25808,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1res LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -22396,6 +25816,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1min LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -22404,6 +25825,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimu LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -22411,6 +25833,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = OpenChannel_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -22419,6 +25842,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } @@ -22426,6 +25850,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -22434,6 +25859,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1de LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -22441,6 +25867,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1acce LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -22449,6 +25876,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepte LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -22456,6 +25884,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1fundi LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -22465,6 +25894,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pub LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22475,6 +25905,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revoc LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22484,6 +25915,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22494,6 +25926,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payme LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22503,6 +25936,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1poi LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22513,6 +25947,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delay LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22522,6 +25957,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1pay LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22532,6 +25968,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22541,6 +25978,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepo LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22551,6 +25989,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22560,6 +25999,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22570,6 +26010,7 @@ JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1f LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = OpenChannel_get_channel_flags(&this_ptr_conv); return ret_val; } @@ -22578,17 +26019,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1fla LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_flags(&this_ptr_conv, val); } +static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOpenChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OpenChannel_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKOpenChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22600,6 +26065,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *en LDKAcceptChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AcceptChannel_free(this_obj_conv); } @@ -22607,6 +26073,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1tem LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22616,6 +26083,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_ LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22626,6 +26094,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1l LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -22634,6 +26103,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limi LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -22641,6 +26111,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1ht LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -22649,6 +26120,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_ LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -22656,6 +26128,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -22664,6 +26137,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1r LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -22671,6 +26145,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1m LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -22679,6 +26154,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1mini LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -22686,6 +26162,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = AcceptChannel_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -22694,6 +26171,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1d LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } @@ -22701,6 +26179,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1sel LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -22709,6 +26188,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1 LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -22716,6 +26196,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1ac LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -22724,6 +26205,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accep LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -22731,6 +26213,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fun LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -22740,6 +26223,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22750,6 +26234,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1rev LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22759,6 +26244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22769,6 +26255,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1pay LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22778,6 +26265,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22788,6 +26276,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1del LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22797,6 +26286,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22807,6 +26297,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htl LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22816,6 +26307,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1base LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22826,6 +26318,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fir LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22835,20 +26328,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } +static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { + LDKAcceptChannel ret_var = AcceptChannel_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAcceptChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AcceptChannel_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAcceptChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22860,6 +26377,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *e LDKFundingCreated this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingCreated_free(this_obj_conv); } @@ -22867,6 +26385,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1te LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22876,6 +26395,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22886,6 +26406,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fu LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv)); return ret_arr; @@ -22895,6 +26416,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1 LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22905,6 +26427,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fundin LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); return ret_val; } @@ -22913,6 +26436,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1 LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); FundingCreated_set_funding_output_index(&this_ptr_conv, val); } @@ -22920,6 +26444,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1si LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -22929,6 +26454,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -22949,6 +26475,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22956,14 +26483,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv return ret_ref; } +static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { + LDKFundingCreated ret_var = FundingCreated_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingCreated arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingCreated_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingCreated orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22975,6 +26525,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *en LDKFundingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingSigned_free(this_obj_conv); } @@ -22982,6 +26533,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1cha LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -22991,6 +26543,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1i LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23001,6 +26554,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1sig LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23010,6 +26564,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature( LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23027,6 +26582,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23034,14 +26590,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * return ret_ref; } +static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { + LDKFundingSigned ret_var = FundingSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23053,6 +26632,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv *en LDKFundingLocked this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingLocked_free(this_obj_conv); } @@ -23060,6 +26640,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1cha LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingLocked_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23069,6 +26650,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1i LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23079,6 +26661,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1nex LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -23088,6 +26671,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_ LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -23105,6 +26689,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23112,14 +26697,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * return ret_ref; } +static inline uint64_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { + LDKFundingLocked ret_var = FundingLocked_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingLocked arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingLocked_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingLocked orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23131,6 +26739,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jc LDKShutdown this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Shutdown_free(this_obj_conv); } @@ -23138,6 +26747,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_ LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23147,6 +26757,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNI LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23157,6 +26768,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpu LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -23167,6 +26779,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JN LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -23186,6 +26799,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23193,14 +26807,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { + LDKShutdown ret_var = Shutdown_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdown arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Shutdown_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKShutdown orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdown ret_var = Shutdown_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23212,6 +26849,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JN LDKClosingSignedFeeRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSignedFeeRange_free(this_obj_conv); } @@ -23219,6 +26857,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_ LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23227,6 +26866,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1mi LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); } @@ -23234,6 +26874,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_ LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23242,6 +26883,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1ma LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); } @@ -23250,6 +26892,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23257,14 +26900,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new( return ret_ref; } +static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSignedFeeRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosingSignedFeeRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23276,6 +26942,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *en LDKClosingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSigned_free(this_obj_conv); } @@ -23283,6 +26950,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1cha LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23292,6 +26960,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1i LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23302,6 +26971,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1sa LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSigned_get_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23310,6 +26980,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satos LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); } @@ -23317,6 +26988,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1sig LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23326,6 +26998,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature( LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23336,11 +27009,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1ra LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23353,9 +27028,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ClosingSignedFeeRange_clone(&val_conv); ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } @@ -23370,11 +27047,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * LDKClosingSignedFeeRange fee_range_arg_conv; fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23382,14 +27061,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * return ret_ref; } +static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { + LDKClosingSigned ret_var = ClosingSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23401,6 +27103,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *en LDKUpdateAddHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateAddHTLC_free(this_obj_conv); } @@ -23408,6 +27111,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cha LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23417,6 +27121,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1i LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23427,6 +27132,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1i LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23435,6 +27141,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(J LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23442,6 +27149,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_ LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -23450,6 +27158,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1ms LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); } @@ -23457,6 +27166,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1pay LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv)); return ret_arr; @@ -23466,6 +27176,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1h LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23476,6 +27187,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1e LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -23484,17 +27196,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expi LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); } +static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateAddHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateAddHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23506,6 +27242,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv LDKUpdateFulfillHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFulfillHTLC_free(this_obj_conv); } @@ -23513,6 +27250,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_ LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23522,6 +27260,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channe LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23532,6 +27271,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htl LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23540,6 +27280,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1 LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23547,6 +27288,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_ LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv)); return ret_arr; @@ -23556,6 +27298,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1paymen LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23573,6 +27316,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23580,14 +27324,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE return ret_ref; } +static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFulfillHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFulfillHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23599,6 +27366,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *e LDKUpdateFailHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailHTLC_free(this_obj_conv); } @@ -23606,6 +27374,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1ch LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23615,6 +27384,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1 LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23625,6 +27395,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1 LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23633,17 +27404,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id( LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); } +static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFailHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23655,6 +27450,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free( LDKUpdateFailMalformedHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailMalformedHTLC_free(this_obj_conv); } @@ -23662,6 +27458,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23671,6 +27468,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23681,6 +27479,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1ge LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23689,6 +27488,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23696,6 +27496,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1ge LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); return ret_val; } @@ -23704,17 +27505,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); } +static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailMalformedHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFailMalformedHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23726,6 +27551,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentSigned_free(this_obj_conv); } @@ -23733,6 +27559,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1 LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23742,6 +27569,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23752,6 +27580,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1 LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23761,6 +27590,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signatu LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23771,6 +27601,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1s LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -23811,6 +27642,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23818,14 +27650,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn return ret_ref; } +static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { + LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23837,6 +27692,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env LDKRevokeAndACK this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RevokeAndACK_free(this_obj_conv); } @@ -23844,6 +27700,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1chan LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23853,6 +27710,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23863,6 +27721,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_ LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv)); return ret_arr; @@ -23872,6 +27731,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commit LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23882,6 +27742,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -23891,6 +27752,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1 LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -23911,6 +27773,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23918,14 +27781,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *e return ret_ref; } +static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { + LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRevokeAndACK arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRevokeAndACK orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23937,6 +27823,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, j LDKUpdateFee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFee_free(this_obj_conv); } @@ -23944,6 +27831,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23953,6 +27841,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JN LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23963,6 +27852,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1pe LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateFee_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -23971,6 +27861,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1 LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } @@ -23982,6 +27873,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23989,14 +27881,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { + LDKUpdateFee ret_var = UpdateFee_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFee_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24008,6 +27923,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * LDKDataLossProtect this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DataLossProtect_free(this_obj_conv); } @@ -24015,6 +27931,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1y LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv)); return ret_arr; @@ -24024,6 +27941,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1la LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24034,6 +27952,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1m LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -24043,6 +27962,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1curr LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24060,6 +27980,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24067,14 +27988,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv return ret_ref; } +static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { + LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDataLossProtect arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DataLossProtect_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDataLossProtect orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24086,6 +28030,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEn LDKChannelReestablish this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelReestablish_free(this_obj_conv); } @@ -24093,6 +28038,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -24102,6 +28048,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1chann LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24112,6 +28059,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1ne LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); return ret_val; } @@ -24120,6 +28068,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_ LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); } @@ -24127,6 +28076,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1ne LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); return ret_val; } @@ -24135,17 +28085,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_ LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); } +static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { + LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelReestablish arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelReestablish orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24157,6 +28131,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(J LDKAnnouncementSignatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AnnouncementSignatures_free(this_obj_conv); } @@ -24164,6 +28139,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -24173,6 +28149,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1c LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24183,6 +28160,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24191,6 +28169,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1s LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); } @@ -24198,6 +28177,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24207,6 +28187,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1n LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24217,6 +28198,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24226,6 +28208,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1b LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24246,6 +28229,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24253,14 +28237,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new return ret_ref; } +static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAnnouncementSignatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAnnouncementSignatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24277,6 +28284,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, NetAddress_free(this_ptr_conv); } +static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetAddress* arg_conv = (LDKNetAddress*)arg; + int64_t ret_val = NetAddress_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetAddress* orig_conv = (LDKNetAddress*)orig; LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); @@ -24348,6 +28367,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free LDKUnsignedNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedNodeAnnouncement_free(this_obj_conv); } @@ -24355,10 +28375,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1g LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24370,9 +28392,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -24381,6 +28405,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1g LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); return ret_val; } @@ -24389,6 +28414,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); } @@ -24396,6 +28422,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -24405,6 +28432,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24415,6 +28443,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 3); (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv)); return ret_arr; @@ -24424,6 +28453,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 3); (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); @@ -24434,6 +28464,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv)); return ret_arr; @@ -24443,6 +28474,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24453,6 +28485,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -24472,14 +28505,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24491,6 +28547,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv LDKNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncement_free(this_obj_conv); } @@ -24498,6 +28555,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1 LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24507,6 +28565,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signatu LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24517,10 +28576,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1cont LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24532,9 +28593,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1content LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedNodeAnnouncement_clone(&val_conv); NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -24546,11 +28609,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn LDKUnsignedNodeAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24558,14 +28623,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn return ret_ref; } +static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24577,6 +28665,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1f LDKUnsignedChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelAnnouncement_free(this_obj_conv); } @@ -24584,10 +28673,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24599,9 +28690,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -24610,6 +28703,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -24619,6 +28713,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24629,6 +28724,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24637,6 +28733,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); } @@ -24644,6 +28741,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form); return ret_arr; @@ -24653,6 +28751,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24663,6 +28762,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form); return ret_arr; @@ -24672,6 +28772,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24682,6 +28783,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form); return ret_arr; @@ -24691,6 +28793,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24701,6 +28804,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form); return ret_arr; @@ -24710,20 +28814,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } +static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24735,6 +28863,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIE LDKChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelAnnouncement_free(this_obj_conv); } @@ -24742,6 +28871,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form); return ret_arr; @@ -24751,6 +28881,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24761,6 +28892,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form); return ret_arr; @@ -24770,6 +28902,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24780,6 +28913,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form); return ret_arr; @@ -24789,6 +28923,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24799,6 +28934,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form); return ret_arr; @@ -24808,6 +28944,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24818,10 +28955,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1c LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24833,9 +28972,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1cont LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelAnnouncement_clone(&val_conv); ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -24856,11 +28997,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN LDKUnsignedChannelAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24868,14 +29011,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN return ret_ref; } +static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24887,6 +29053,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JN LDKUnsignedChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelUpdate_free(this_obj_conv); } @@ -24894,6 +29061,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1 LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -24903,6 +29071,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ch LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24913,6 +29082,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24921,6 +29091,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1sh LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); } @@ -24928,6 +29099,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); return ret_val; } @@ -24936,6 +29108,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ti LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } @@ -24943,6 +29116,7 @@ JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1 LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = UnsignedChannelUpdate_get_flags(&this_ptr_conv); return ret_val; } @@ -24951,6 +29125,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fl LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } @@ -24958,6 +29133,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -24966,6 +29142,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cl LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -24973,6 +29150,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -24981,6 +29159,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ht LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -24988,6 +29167,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -24996,6 +29176,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fe LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); } @@ -25003,6 +29184,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -25011,17 +29193,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fe LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); } +static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25033,6 +29239,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *en LDKChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelUpdate_free(this_obj_conv); } @@ -25040,6 +29247,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1sig LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -25049,6 +29257,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature( LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -25059,10 +29268,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1content LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25074,9 +29285,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(J LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelUpdate_clone(&val_conv); ChannelUpdate_set_contents(&this_ptr_conv, val_conv); } @@ -25088,11 +29301,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * LDKUnsignedChannelUpdate contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25100,14 +29315,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * return ret_ref; } +static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { + LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25119,6 +29357,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv LDKQueryChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryChannelRange_free(this_obj_conv); } @@ -25126,6 +29365,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25135,6 +29375,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25145,6 +29386,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1fir LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -25153,6 +29395,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -25160,6 +29403,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1num LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -25168,6 +29412,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -25179,6 +29424,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25186,14 +29432,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIE return ret_ref; } +static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { + LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKQueryChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25205,6 +29474,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv LDKReplyChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyChannelRange_free(this_obj_conv); } @@ -25212,6 +29482,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25221,6 +29492,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25231,6 +29503,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1fir LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -25239,6 +29512,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -25246,6 +29520,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1num LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -25254,6 +29529,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -25261,6 +29537,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sy LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyChannelRange_get_sync_complete(&this_ptr_conv); return ret_val; } @@ -25269,6 +29546,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1 LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); } @@ -25276,6 +29554,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25311,6 +29590,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25318,14 +29598,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIE return ret_ref; } +static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKReplyChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25337,6 +29640,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNI LDKQueryShortChannelIds this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryShortChannelIds_free(this_obj_conv); } @@ -25344,6 +29648,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1g LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25353,6 +29658,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1cha LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25363,6 +29669,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1sho LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25398,6 +29705,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(J uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25405,14 +29713,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(J return ret_ref; } +static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryShortChannelIds arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKQueryShortChannelIds orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25424,6 +29755,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free( LDKReplyShortChannelIdsEnd this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyShortChannelIdsEnd_free(this_obj_conv); } @@ -25431,6 +29763,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25440,6 +29773,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1 LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25450,6 +29784,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1g LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); return ret_val; } @@ -25458,6 +29793,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1 LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); } @@ -25469,6 +29805,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1ne uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25476,14 +29813,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1ne return ret_ref; } +static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyShortChannelIdsEnd arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKReplyShortChannelIdsEnd orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25495,6 +29855,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JN LDKGossipTimestampFilter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); GossipTimestampFilter_free(this_obj_conv); } @@ -25502,6 +29863,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1 LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25511,6 +29873,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ch LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25521,6 +29884,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); return ret_val; } @@ -25529,6 +29893,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1fi LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); } @@ -25536,6 +29901,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); return ret_val; } @@ -25544,6 +29910,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ti LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); } @@ -25555,6 +29922,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25562,14 +29930,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new( return ret_ref; } +static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKGossipTimestampFilter arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKGossipTimestampFilter orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25586,6 +29977,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, ErrorAction_free(this_ptr_conv); } +static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorAction* arg_conv = (LDKErrorAction*)arg; + int64_t ret_val = ErrorAction_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKErrorAction* orig_conv = (LDKErrorAction*)orig; LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); @@ -25598,6 +30001,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1pe LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_disconnect_peer(msg_conv); @@ -25624,6 +30028,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1m LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_send_error_message(msg_conv); @@ -25635,6 +30040,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *e LDKLightningError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LightningError_free(this_obj_conv); } @@ -25642,6 +30048,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JN LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = LightningError_get_err(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -25652,6 +30059,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEn LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); LightningError_set_err(&this_ptr_conv, val_conv); } @@ -25660,6 +30068,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = LightningError_get_action(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -25670,6 +30079,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JN LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); @@ -25687,6 +30097,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25694,14 +30105,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv return ret_ref; } +static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { + LDKLightningError ret_var = LightningError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKLightningError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = LightningError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKLightningError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKLightningError ret_var = LightningError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25713,6 +30147,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv LDKCommitmentUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentUpdate_free(this_obj_conv); } @@ -25720,6 +30155,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25729,6 +30165,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_15_ref = 0; CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner; if (ret_conv_15_var.is_owned) { ret_conv_15_ref |= 1; @@ -25744,6 +30181,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25756,6 +30194,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateAddHTLC val_conv_15_conv; val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); val_constr.data[p] = val_conv_15_conv; } @@ -25767,6 +30206,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25776,6 +30216,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_19_ref = 0; CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner; if (ret_conv_19_var.is_owned) { ret_conv_19_ref |= 1; @@ -25791,6 +30232,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25803,6 +30245,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFulfillHTLC val_conv_19_conv; val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); val_constr.data[t] = val_conv_19_conv; } @@ -25814,6 +30257,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25823,6 +30267,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -25838,6 +30283,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25850,6 +30296,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFailHTLC val_conv_16_conv; val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); val_constr.data[q] = val_conv_16_conv; } @@ -25861,6 +30308,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25870,6 +30318,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_25_ref = 0; CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner; if (ret_conv_25_var.is_owned) { ret_conv_25_ref |= 1; @@ -25885,6 +30334,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25897,6 +30347,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFailMalformedHTLC val_conv_25_conv; val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); val_constr.data[z] = val_conv_25_conv; } @@ -25908,11 +30359,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1upda LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25925,9 +30378,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UpdateFee_clone(&val_conv); CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); } @@ -25936,10 +30391,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1comm LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25951,9 +30408,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitm LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CommitmentSigned_clone(&val_conv); CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); } @@ -25971,6 +30430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; } @@ -25987,6 +30447,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; } @@ -26003,6 +30464,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; } @@ -26019,6 +30481,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; } @@ -26026,15 +30489,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFee update_fee_arg_conv; update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); LDKCommitmentSigned commitment_signed_arg_conv; commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26042,14 +30508,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn return ret_ref; } +static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26079,6 +30568,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JN LDKAcceptChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26100,6 +30590,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26121,6 +30612,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1wri LDKChannelReestablish obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26142,6 +30634,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JN LDKClosingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26163,6 +30656,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1 LDKClosingSignedFeeRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26184,6 +30678,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write LDKCommitmentSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26205,6 +30700,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(J LDKFundingCreated obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26226,6 +30722,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JN LDKFundingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26247,6 +30744,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JN LDKFundingLocked obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26268,6 +30766,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env LDKInit obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Init_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26289,6 +30788,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIE LDKOpenChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26310,6 +30810,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNI LDKRevokeAndACK obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26331,6 +30832,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv LDKShutdown obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26352,6 +30854,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(J LDKUpdateFailHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26373,6 +30876,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC LDKUpdateFailMalformedHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26394,6 +30898,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv LDKUpdateFee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26415,6 +30920,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1writ LDKUpdateFulfillHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26436,6 +30942,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JN LDKUpdateAddHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26457,6 +30964,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env LDKPing obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Ping_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26478,6 +30986,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env LDKPong obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Pong_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26499,6 +31008,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26520,6 +31030,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1wr LDKChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26541,6 +31052,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1 LDKUnsignedChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26562,6 +31074,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JN LDKChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26583,6 +31096,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNI LDKErrorMessage obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26604,6 +31118,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26625,6 +31140,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write LDKNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26656,6 +31172,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1w LDKQueryShortChannelIds obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26667,6 +31184,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd LDKReplyShortChannelIdsEnd obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26688,6 +31206,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blo LDKQueryChannelRange this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv); return ret_val; } @@ -26696,6 +31215,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1writ LDKQueryChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26727,6 +31247,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1writ LDKReplyChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26738,6 +31259,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1 LDKGossipTimestampFilter obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26768,6 +31290,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(J LDKIgnoringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); IgnoringMessageHandler_free(this_obj_conv); } @@ -26776,6 +31299,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26787,6 +31311,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -26796,6 +31321,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26805,6 +31331,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); return (uint64_t)ret_ret; @@ -26814,6 +31341,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26823,6 +31351,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(J LDKErroringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErroringMessageHandler_free(this_obj_conv); } @@ -26831,6 +31360,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26842,6 +31372,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_ LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -26851,6 +31382,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_ LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26860,6 +31392,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *e LDKMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MessageHandler_free(this_obj_conv); } @@ -26867,6 +31400,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1 LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -26876,6 +31410,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1han LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); @@ -26890,6 +31425,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_ LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -26899,6 +31435,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1ha LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); @@ -26928,6 +31465,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26935,6 +31473,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv return ret_ref; } +static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; + int64_t ret_val = SocketDescriptor_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -26957,6 +31508,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * LDKPeerHandleError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerHandleError_free(this_obj_conv); } @@ -26964,6 +31516,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1 LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv); return ret_val; } @@ -26972,6 +31525,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1conn LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); } @@ -26980,6 +31534,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26987,14 +31542,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv return ret_ref; } +static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { + LDKPeerHandleError ret_var = PeerHandleError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPeerHandleError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PeerHandleError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPeerHandleError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27006,6 +31584,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, LDKPeerManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerManager_free(this_obj_conv); } @@ -27013,6 +31592,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en LDKMessageHandler message_handler_conv; message_handler_conv.inner = (void*)(message_handler & (~1)); message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); // Warning: we need a move here but no clone is available for LDKMessageHandler LDKSecretKey our_node_secret_ref; CHECK((*env)->GetArrayLength(env, our_node_secret) == 32); @@ -27039,6 +31619,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27050,6 +31631,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); @@ -27068,6 +31650,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_ LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_node_id_ref; CHECK((*env)->GetArrayLength(env, their_node_id) == 33); (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form); @@ -27087,6 +31670,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); @@ -27103,6 +31687,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_ LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -27115,6 +31700,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JN LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1); if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; @@ -27131,6 +31717,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(J LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_process_events(&this_arg_conv); } @@ -27138,6 +31725,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnec LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -27148,6 +31736,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1n LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey node_id_ref; CHECK((*env)->GetArrayLength(env, node_id) == 33); (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); @@ -27158,6 +31747,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_disconnect_all_peers(&this_arg_conv); } @@ -27165,6 +31755,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occu LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_timer_tick_occurred(&this_arg_conv); } @@ -27190,6 +31781,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transac LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); @@ -27253,6 +31845,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *e LDKTxCreationKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TxCreationKeys_free(this_obj_conv); } @@ -27260,6 +31853,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1pe LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -27269,6 +31863,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1comm LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27279,6 +31874,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1re LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27288,6 +31884,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocatio LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27298,6 +31895,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1br LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27307,6 +31905,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27317,6 +31916,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1co LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27326,6 +31926,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersi LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27336,6 +31937,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1br LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27345,6 +31947,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27371,6 +31974,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27378,14 +31982,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv return ret_ref; } +static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { + LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxCreationKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKTxCreationKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27397,6 +32024,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(J LDKTxCreationKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27418,6 +32046,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv LDKChannelPublicKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelPublicKeys_free(this_obj_conv); } @@ -27425,6 +32054,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -27434,6 +32064,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1fundin LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27444,6 +32075,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27453,6 +32085,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revoca LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27463,6 +32096,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -27472,6 +32106,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1paymen LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27482,6 +32117,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27491,6 +32127,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delaye LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27501,6 +32138,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27510,6 +32148,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1 LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27536,6 +32175,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27543,14 +32183,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE return ret_ref; } +static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelPublicKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelPublicKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27562,6 +32225,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1writ LDKChannelPublicKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27607,9 +32271,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -27633,6 +32299,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(J LDKHTLCOutputInCommitment this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCOutputInCommitment_free(this_obj_conv); } @@ -27640,6 +32307,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1ge LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv); return ret_val; } @@ -27648,6 +32316,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1o LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); } @@ -27655,6 +32324,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -27663,6 +32333,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1a LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); } @@ -27670,6 +32341,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -27678,6 +32350,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1c LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); } @@ -27685,6 +32358,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_ LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); return ret_arr; @@ -27694,6 +32368,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1p LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -27704,6 +32379,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -27714,6 +32390,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1t LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -27733,6 +32410,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27740,14 +32418,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new return ret_ref; } +static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCOutputInCommitment arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHTLCOutputInCommitment orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27759,6 +32460,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_ LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27780,9 +32482,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKTxCreationKeys keys_conv; keys_conv.inner = (void*)(keys & (~1)); keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27812,6 +32516,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transactio LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); @@ -27829,6 +32534,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelTransactionParameters_free(this_obj_conv); } @@ -27836,10 +32542,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27851,9 +32559,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } @@ -27862,6 +32572,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -27870,6 +32581,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } @@ -27877,6 +32589,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParamete LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); return ret_val; } @@ -27885,6 +32598,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); } @@ -27892,11 +32606,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27909,9 +32625,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); } @@ -27920,11 +32638,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27937,9 +32657,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } @@ -27948,19 +32670,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); LDKOutPoint funding_outpoint_arg_conv; funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27968,14 +32694,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } +static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27987,6 +32736,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyChannelTransactionParameters_free(this_obj_conv); } @@ -27994,10 +32744,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28009,9 +32761,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } @@ -28020,6 +32774,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -28028,6 +32783,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } @@ -28035,11 +32791,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKChannelPublicKeys pubkeys_arg_conv; pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28047,14 +32805,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } +static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCounterpartyChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28066,6 +32847,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParamete LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelTransactionParameters_is_populated(&this_arg_conv); return ret_val; } @@ -28074,10 +32856,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28089,10 +32873,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28104,6 +32890,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTran LDKCounterpartyChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28125,6 +32912,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParam LDKChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28146,6 +32934,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionPara LDKDirectedChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectedChannelTransactionParameters_free(this_obj_conv); } @@ -28153,10 +32942,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28168,10 +32959,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28183,6 +32976,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); return ret_val; } @@ -28191,6 +32985,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransaction LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); return ret_val; } @@ -28199,10 +32994,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28214,6 +33011,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1f LDKHolderCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HolderCommitmentTransaction_free(this_obj_conv); } @@ -28221,6 +33019,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransac LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); return ret_arr; @@ -28230,6 +33029,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -28240,6 +33040,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -28256,14 +33057,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } +static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHolderCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHolderCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28275,6 +33099,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransac LDKHolderCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28296,6 +33121,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); LDKSignature counterparty_sig_ref; CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64); @@ -28323,6 +33149,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28334,6 +33161,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1fr LDKBuiltCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BuiltCommitmentTransaction_free(this_obj_conv); } @@ -28341,6 +33169,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28352,6 +33181,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); @@ -28364,6 +33194,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv)); return ret_arr; @@ -28373,6 +33204,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -28392,6 +33224,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28399,14 +33232,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_ return ret_ref; } +static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBuiltCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBuiltCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28418,6 +33274,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28439,6 +33296,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); @@ -28452,6 +33310,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK((*env)->GetArrayLength(env, funding_key) == 32); (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); @@ -28469,17 +33328,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEn LDKClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingTransaction_free(this_obj_conv); } +static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { + LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosingTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28491,6 +33374,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JN LDKClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ClosingTransaction_hash(&o_conv); return ret_val; } @@ -28507,11 +33391,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNI LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28523,10 +33409,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(J LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28538,9 +33426,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify( LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); @@ -28551,6 +33441,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1hol LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_holder_value_sat(&this_arg_conv); return ret_val; } @@ -28559,6 +33450,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1cou LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); return ret_val; } @@ -28567,6 +33459,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_ LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28577,6 +33470,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_ LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28587,6 +33481,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1fre LDKTrustedClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedClosingTransaction_free(this_obj_conv); } @@ -28594,6 +33489,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28605,6 +33501,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); @@ -28618,6 +33515,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK((*env)->GetArrayLength(env, funding_key) == 32); (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); @@ -28635,17 +33533,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JN LDKCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentTransaction_free(this_obj_conv); } +static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28657,6 +33579,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1 LDKCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28678,6 +33601,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1comm LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_commitment_number(&this_arg_conv); return ret_val; } @@ -28686,6 +33610,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1 LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); return ret_val; } @@ -28694,6 +33619,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1 LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); return ret_val; } @@ -28702,6 +33628,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feer LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = CommitmentTransaction_feerate_per_kw(&this_arg_conv); return ret_val; } @@ -28710,10 +33637,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trus LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28725,15 +33654,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1veri LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -28743,6 +33676,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1 LDKTrustedCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedCommitmentTransaction_free(this_obj_conv); } @@ -28750,6 +33684,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransa LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data); return ret_arr; @@ -28759,10 +33694,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28774,10 +33711,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28789,6 +33728,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char htlc_base_key_arr[32]; CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr); @@ -28796,6 +33736,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); return (uint64_t)ret_conv; @@ -28816,9 +33757,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *e LDKInitFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInitFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InitFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28827,9 +33770,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *e LDKNodeFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKNodeFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = NodeFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28838,9 +33783,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv LDKChannelFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKChannelFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ChannelFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28849,21 +33796,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv LDKInvoiceFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceFeatures_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInitFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InitFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInitFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28871,14 +33843,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv return ret_ref; } +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28886,14 +33881,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv return ret_ref; } +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28901,14 +33919,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIE return ret_ref; } +static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoiceFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28920,6 +33961,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env LDKInitFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InitFeatures_free(this_obj_conv); } @@ -28927,6 +33969,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env LDKNodeFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeFeatures_free(this_obj_conv); } @@ -28934,6 +33977,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * LDKChannelFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelFeatures_free(this_obj_conv); } @@ -28941,6 +33985,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv * LDKInvoiceFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceFeatures_free(this_obj_conv); } @@ -28949,6 +33994,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28961,6 +34007,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28972,6 +34019,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1un LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -28981,6 +34029,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28993,6 +34042,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29004,6 +34054,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1un LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29013,6 +34064,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29025,6 +34077,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29036,6 +34089,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_ LDKChannelFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29045,6 +34099,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29057,6 +34112,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29068,6 +34124,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_ LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29076,6 +34133,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1pa LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29084,6 +34142,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1pa LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29092,6 +34151,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_ LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29100,6 +34160,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNI LDKInitFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29111,6 +34172,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNI LDKNodeFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29122,6 +34184,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write( LDKChannelFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29133,6 +34196,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write( LDKInvoiceFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29184,17 +34248,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *e LDKShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ShutdownScript_free(this_obj_conv); } +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29206,6 +34294,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JN LDKInvalidShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvalidShutdownScript_free(this_obj_conv); } @@ -29213,6 +34302,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1 LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29223,6 +34313,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1sc LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -29239,6 +34330,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29246,14 +34338,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new( return ret_ref; } +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvalidShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvalidShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29265,6 +34380,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(J LDKShutdownScript obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29291,6 +34407,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29307,6 +34424,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29328,6 +34446,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1i LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = ShutdownScript_clone(&this_arg_conv); LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); @@ -29340,6 +34459,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1leg LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form); return ret_arr; @@ -29349,9 +34469,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compat LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInitFeatures features_conv; features_conv.inner = (void*)(features & (~1)); features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); jboolean ret_val = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_val; } @@ -29365,6 +34487,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIE CustomMessageReader_free(this_ptr_conv); } +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_val = Type_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -29396,6 +34531,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *en LDKLockableScore this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockableScore_free(this_obj_conv); } @@ -29411,6 +34547,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29422,6 +34559,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LockableScore_1write(JN LDKLockableScore obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29433,17 +34571,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jcla LDKNodeId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeId_free(this_obj_conv); } +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeId_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeId ret_var = NodeId_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29459,6 +34621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29470,6 +34633,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEn LDKNodeId this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29480,6 +34644,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, j LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = NodeId_hash(&o_conv); return ret_val; } @@ -29488,6 +34653,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *e LDKNodeId obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29509,17 +34675,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env LDKNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetworkGraph_free(this_obj_conv); } +static inline uint64_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { + LDKNetworkGraph ret_var = NetworkGraph_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetworkGraph arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NetworkGraph_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetworkGraph orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29531,6 +34721,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNI LDKReadOnlyNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReadOnlyNetworkGraph_free(this_obj_conv); } @@ -29543,6 +34734,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *en NetworkUpdate_free(this_ptr_conv); } +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)arg; + int64_t ret_val = NetworkUpdate_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)orig; LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); @@ -29555,6 +34758,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1upd LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_update_message(msg_conv); @@ -29588,10 +34792,21 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JN return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -29601,6 +34816,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEn LDKNetGraphMsgHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetGraphMsgHandler_free(this_obj_conv); } @@ -29608,6 +34824,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -29630,6 +34847,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29641,6 +34859,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -29659,6 +34878,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Rou LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -29668,6 +34888,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Mes LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -29677,6 +34898,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(J LDKDirectionalChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectionalChannelInfo_free(this_obj_conv); } @@ -29684,6 +34906,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = DirectionalChannelInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -29692,6 +34915,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_last_update(&this_ptr_conv, val); } @@ -29699,6 +34923,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1ge LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = DirectionalChannelInfo_get_enabled(&this_ptr_conv); return ret_val; } @@ -29707,6 +34932,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1e LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_enabled(&this_ptr_conv, val); } @@ -29714,6 +34940,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -29722,6 +34949,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1c LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -29729,6 +34957,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DirectionalChannelInfo_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -29737,6 +34966,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -29744,6 +34974,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -29754,6 +34985,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -29765,10 +34997,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29780,9 +35014,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1f LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); DirectionalChannelInfo_set_fees(&this_ptr_conv, val_conv); } @@ -29791,11 +35027,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29808,9 +35046,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelUpdate_clone(&val_conv); DirectionalChannelInfo_set_last_update_message(&this_ptr_conv, val_conv); } @@ -29823,15 +35063,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); LDKChannelUpdate last_update_message_arg_conv; last_update_message_arg_conv.inner = (void*)(last_update_message_arg & (~1)); last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29839,14 +35082,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new return ret_ref; } +static inline uint64_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg) { + LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDirectionalChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDirectionalChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29858,6 +35124,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_ LDKDirectionalChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29879,6 +35146,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, LDKChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelInfo_free(this_obj_conv); } @@ -29886,10 +35154,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features( LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29901,9 +35171,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNI LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); ChannelInfo_set_features(&this_ptr_conv, val_conv); } @@ -29912,10 +35184,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29927,9 +35201,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JN LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } @@ -29938,11 +35214,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29955,9 +35233,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); } @@ -29966,10 +35246,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29981,9 +35263,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JN LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } @@ -29992,11 +35276,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30009,9 +35295,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } @@ -30020,6 +35308,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -30030,6 +35319,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sa LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -30041,11 +35331,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcem LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30058,9 +35350,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelAnnouncement_clone(&val_conv); ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -30069,22 +35363,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en LDKChannelFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = ChannelFeatures_clone(&features_arg_conv); LDKNodeId node_one_arg_conv; node_one_arg_conv.inner = (void*)(node_one_arg & (~1)); node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv); node_one_arg_conv = NodeId_clone(&node_one_arg_conv); LDKDirectionalChannelInfo one_to_two_arg_conv; one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1)); one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv); one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv); LDKNodeId node_two_arg_conv; node_two_arg_conv.inner = (void*)(node_two_arg & (~1)); node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv); node_two_arg_conv = NodeId_clone(&node_two_arg_conv); LDKDirectionalChannelInfo two_to_one_arg_conv; two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1)); two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv); two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv); void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1); CHECK_ACCESS(capacity_sats_arg_ptr); @@ -30093,11 +35392,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en LDKChannelAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv); LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30105,14 +35406,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en return ret_ref; } +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30124,6 +35448,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIE LDKChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30145,6 +35470,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, LDKRoutingFees this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RoutingFees_free(this_obj_conv); } @@ -30152,6 +35478,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msa LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_base_msat(&this_ptr_conv); return ret_val; } @@ -30160,6 +35487,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(J LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_base_msat(&this_ptr_conv, val); } @@ -30167,6 +35495,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportio LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -30175,6 +35504,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } @@ -30183,6 +35513,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *en uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30194,21 +35525,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *en LDKRoutingFees a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoutingFees b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RoutingFees_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RoutingFees_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRoutingFees orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30220,6 +35576,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *e LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RoutingFees_hash(&o_conv); return ret_val; } @@ -30228,6 +35585,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIE LDKRoutingFees obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30249,6 +35607,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNI LDKNodeAnnouncementInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncementInfo_free(this_obj_conv); } @@ -30256,10 +35615,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30271,9 +35632,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1fea LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); } @@ -30282,6 +35645,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -30290,6 +35654,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1las LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); } @@ -30297,6 +35662,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1g LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 3); (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv)); return ret_arr; @@ -30306,6 +35672,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 3); (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); @@ -30316,6 +35683,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1g LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(&this_ptr_conv)); return ret_arr; @@ -30325,6 +35693,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ali LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -30335,6 +35704,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1add LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -30358,11 +35728,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30375,9 +35747,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ann LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncement_clone(&val_conv); NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -30386,6 +35760,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J LDKNodeFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = NodeFeatures_clone(&features_arg_conv); LDKThreeBytes rgb_arg_ref; CHECK((*env)->GetArrayLength(env, rgb_arg) == 3); @@ -30411,11 +35786,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J LDKNodeAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, announcement_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30423,14 +35800,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J return ret_ref; } +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncementInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeAnnouncementInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30442,6 +35842,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1w LDKNodeAnnouncementInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30463,6 +35864,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jc LDKNodeInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeInfo_free(this_obj_conv); } @@ -30470,6 +35872,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -30489,11 +35892,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbo LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30506,9 +35911,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv); } @@ -30517,11 +35924,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30534,9 +35943,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1i LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncementInfo_clone(&val_conv); NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } @@ -30557,15 +35968,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, LDKRoutingFees lowest_inbound_channel_fees_arg_conv; lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1)); lowest_inbound_channel_fees_arg_conv.is_owned = (lowest_inbound_channel_fees_arg & 1) || (lowest_inbound_channel_fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv); lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv); LDKNodeAnnouncementInfo announcement_info_arg_conv; announcement_info_arg_conv.inner = (void*)(announcement_info_arg & (~1)); announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30573,14 +35987,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30592,6 +36029,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv LDKNodeInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30613,6 +36051,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNI LDKNetworkGraph obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30638,6 +36077,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30649,10 +36089,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JN LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30664,9 +36106,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30676,9 +36120,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30688,9 +36134,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -30711,9 +36159,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -30734,6 +36184,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1 LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent); } @@ -30741,6 +36192,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node(JNIEn LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey _node_id_ref; CHECK((*env)->GetArrayLength(env, _node_id) == 33); (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form); @@ -30751,9 +36203,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30763,9 +36217,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30775,6 +36231,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1 LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey pubkey_ref; CHECK((*env)->GetArrayLength(env, pubkey) == 33); (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); @@ -30788,6 +36245,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jc LDKRouteHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHop_free(this_obj_conv); } @@ -30795,6 +36253,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(J LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -30804,6 +36263,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -30814,10 +36274,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1featur LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30829,9 +36291,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features( LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); RouteHop_set_node_features(&this_ptr_conv, val_conv); } @@ -30840,6 +36304,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1chann LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -30848,6 +36313,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_ LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_short_channel_id(&this_ptr_conv, val); } @@ -30855,10 +36321,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1fea LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30870,9 +36338,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1featur LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); RouteHop_set_channel_features(&this_ptr_conv, val_conv); } @@ -30881,6 +36351,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JN LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_fee_msat(&this_ptr_conv); return ret_val; } @@ -30889,6 +36360,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEn LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_fee_msat(&this_ptr_conv, val); } @@ -30896,6 +36368,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -30904,6 +36377,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1d LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -30914,15 +36388,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, LDKNodeFeatures node_features_arg_conv; node_features_arg_conv.inner = (void*)(node_features_arg & (~1)); node_features_arg_conv.is_owned = (node_features_arg & 1) || (node_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); LDKChannelFeatures channel_features_arg_conv; channel_features_arg_conv.inner = (void*)(channel_features_arg & (~1)); channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30930,14 +36407,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHop_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHop ret_var = RouteHop_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30949,6 +36449,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHop_hash(&o_conv); return ret_val; } @@ -30957,9 +36458,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, LDKRouteHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHop_eq(&a_conv, &b_conv); return ret_val; } @@ -30968,6 +36471,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv LDKRouteHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30989,6 +36493,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclas LDKRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Route_free(this_obj_conv); } @@ -30996,6 +36501,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIE LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL); @@ -31010,6 +36516,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIE uint64_t ret_conv_12_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var); ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner; if (ret_conv_12_conv_10_var.is_owned) { ret_conv_12_conv_10_ref |= 1; @@ -31029,6 +36536,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31049,6 +36557,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, LDKRouteHop val_conv_12_conv_10_conv; val_conv_12_conv_10_conv.inner = (void*)(val_conv_12_conv_10 & (~1)); val_conv_12_conv_10_conv.is_owned = (val_conv_12_conv_10 & 1) || (val_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv); val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv); val_conv_12_constr.data[k] = val_conv_12_conv_10_conv; } @@ -31062,11 +36571,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payee(JNIEnv *e LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = Route_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31079,9 +36590,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payee(JNIEnv *env, LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); Route_set_payee(&this_ptr_conv, val_conv); } @@ -31107,6 +36620,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl LDKRouteHop paths_arg_conv_12_conv_10_conv; paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1)); paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv; } @@ -31116,11 +36630,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRoute ret_var = Route_new(paths_arg_constr, payee_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31128,14 +36644,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl return ret_ref; } +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Route_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoute ret_var = Route_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31147,6 +36686,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jc LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Route_hash(&o_conv); return ret_val; } @@ -31155,9 +36695,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jcl LDKRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Route_eq(&a_conv, &b_conv); return ret_val; } @@ -31166,6 +36708,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNI LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_fees(&this_arg_conv); return ret_val; } @@ -31174,6 +36717,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(J LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_amount(&this_arg_conv); return ret_val; } @@ -31182,6 +36726,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *en LDKRoute obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Route_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31203,6 +36748,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv * LDKRouteParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteParameters_free(this_obj_conv); } @@ -31210,10 +36756,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payee LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31225,9 +36773,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payee(JN LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); RouteParameters_set_payee(&this_ptr_conv, val_conv); } @@ -31236,6 +36786,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_val; } @@ -31244,6 +36795,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1v LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_value_msat(&this_ptr_conv, val); } @@ -31251,6 +36803,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -31259,6 +36812,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1c LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val); } @@ -31266,11 +36820,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31278,14 +36834,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv return ret_ref; } +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31297,6 +36876,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write( LDKRouteParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31318,6 +36898,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclas LDKPayee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Payee_free(this_obj_conv); } @@ -31325,6 +36906,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1pubkey(JNIE LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Payee_get_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -31334,6 +36916,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1pubkey(JNIEnv *env LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -31344,11 +36927,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1features(JNIEnv LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures ret_var = Payee_get_features(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31361,9 +36946,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1features(JNIEnv *e LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InvoiceFeatures_clone(&val_conv); Payee_set_features(&this_ptr_conv, val_conv); } @@ -31372,6 +36959,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hin LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -31381,6 +36969,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hin uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -31396,6 +36985,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEn LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31408,6 +36998,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEn LDKRouteHint val_conv_11_conv; val_conv_11_conv.inner = (void*)(val_conv_11 & (~1)); val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv); val_conv_11_conv = RouteHint_clone(&val_conv_11_conv); val_constr.data[l] = val_conv_11_conv; } @@ -31419,6 +37010,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1expiry_1time(JN LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Payee_get_expiry_time(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31429,6 +37021,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1expiry_1time(JNIEn LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31443,6 +37036,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl LDKInvoiceFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InvoiceFeatures_clone(&features_arg_conv); LDKCVec_RouteHintZ route_hints_arg_constr; route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg); @@ -31456,6 +37050,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl LDKRouteHint route_hints_arg_conv_11_conv; route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1)); route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv); route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv); route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv; } @@ -31468,6 +37063,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31475,14 +37071,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl return ret_ref; } +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee ret_var = Payee_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPayee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Payee_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPayee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayee ret_var = Payee_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31494,6 +37113,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jc LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Payee_hash(&o_conv); return ret_val; } @@ -31502,9 +37122,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jcl LDKPayee a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayee b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Payee_eq(&a_conv, &b_conv); return ret_val; } @@ -31513,6 +37135,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1write(JNIEnv *en LDKPayee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Payee_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31538,6 +37161,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1from_1node_1id(JNIEn uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31553,6 +37177,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1for_1keysend(JNIEnv uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31564,6 +37189,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, j LDKRouteHint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHint_free(this_obj_conv); } @@ -31571,6 +37197,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIE LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -31580,6 +37207,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIE uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -31595,6 +37223,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31607,6 +37236,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, LDKRouteHintHop val_conv_14_conv; val_conv_14_conv.inner = (void*)(val_conv_14 & (~1)); val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); val_constr.data[o] = val_conv_14_conv; } @@ -31627,6 +37257,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, LDKRouteHintHop a_arg_conv_14_conv; a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1)); a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); a_arg_constr.data[o] = a_arg_conv_14_conv; } @@ -31635,6 +37266,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31642,14 +37274,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHint_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHint ret_var = RouteHint_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31661,6 +37316,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHint_hash(&o_conv); return ret_val; } @@ -31669,9 +37325,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, LDKRouteHint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHint_eq(&a_conv, &b_conv); return ret_val; } @@ -31680,6 +37338,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv LDKRouteHint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31701,6 +37360,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env LDKRouteHintHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHintHop_free(this_obj_conv); } @@ -31708,6 +37368,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_ LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -31717,6 +37378,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1 LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -31727,6 +37389,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1c LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHintHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -31735,6 +37398,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1chan LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_short_channel_id(&this_ptr_conv, val); } @@ -31742,10 +37406,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNI LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31757,9 +37423,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); RouteHintHop_set_fees(&this_ptr_conv, val_conv); } @@ -31768,6 +37436,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1ex LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -31776,6 +37445,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expir LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -31783,6 +37453,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1mi LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31793,6 +37464,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minim LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31804,6 +37476,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1ma LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31814,6 +37487,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maxim LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31828,6 +37502,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1); CHECK_ACCESS(htlc_minimum_msat_arg_ptr); @@ -31841,6 +37516,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31848,14 +37524,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e return ret_ref; } +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHintHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHintHop_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHintHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31867,6 +37566,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv * LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHintHop_hash(&o_conv); return ret_val; } @@ -31875,9 +37575,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *e LDKRouteHintHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHintHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHintHop_eq(&a_conv, &b_conv); return ret_val; } @@ -31886,6 +37588,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNI LDKRouteHintHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31910,9 +37613,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKNetworkGraph network_conv; network_conv.inner = (void*)(network & (~1)); network_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -31927,6 +37632,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); @@ -31952,6 +37658,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free(JNIEnv *env, jcla LDKScorer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Scorer_free(this_obj_conv); } @@ -31959,6 +37666,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free(JNIEnv LDKScoringParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ScoringParameters_free(this_obj_conv); } @@ -31966,6 +37674,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1bas LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv); return ret_val; } @@ -31974,6 +37683,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1 LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val); } @@ -31981,6 +37691,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1fai LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv); return ret_val; } @@ -31989,6 +37700,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failur LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val); } @@ -31996,6 +37708,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1fai LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv); return ret_val; } @@ -32004,6 +37717,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failur LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val); } @@ -32012,6 +37726,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIE uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32023,6 +37738,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1writ LDKScoringParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -32044,11 +37760,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1new(JNIEnv *env, jc LDKScoringParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKScorer ret_var = Scorer_new(params_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32061,6 +37779,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32073,6 +37792,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32084,6 +37804,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1as_1Score(JNIEnv *e LDKScorer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); *ret_ret = Scorer_as_Score(&this_arg_conv); return (uint64_t)ret_ret; @@ -32093,6 +37814,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write(JNIEnv *e LDKScorer obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Scorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -32114,6 +37836,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIE LDKFilesystemPersister this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FilesystemPersister_free(this_obj_conv); } @@ -32123,6 +37846,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JN uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32134,6 +37858,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -32145,6 +37870,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persis LDKChannelManager manager_conv; manager_conv.inner = (void*)(manager & (~1)); manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = FilesystemPersister_persist_manager(data_dir_conv, &manager_conv); return (uint64_t)ret_conv; @@ -32154,6 +37880,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1 LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -32170,6 +37897,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1as_1Pe LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); *ret_ret = FilesystemPersister_as_Persist(&this_arg_conv); return (uint64_t)ret_ret; @@ -32179,6 +37907,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIE LDKBackgroundProcessor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BackgroundProcessor_free(this_obj_conv); } @@ -32209,15 +37938,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( LDKChainMonitor chain_monitor_conv; chain_monitor_conv.inner = (void*)(chain_monitor & (~1)); chain_monitor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv); LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKNetGraphMsgHandler net_graph_msg_handler_conv; net_graph_msg_handler_conv.inner = (void*)(net_graph_msg_handler & (~1)); net_graph_msg_handler_conv.is_owned = (net_graph_msg_handler & 1) || (net_graph_msg_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(net_graph_msg_handler_conv); LDKPeerManager peer_manager_conv; peer_manager_conv.inner = (void*)(peer_manager & (~1)); peer_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -32229,6 +37962,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32240,6 +37974,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1join(J LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_join(this_arg_conv); @@ -32250,6 +37985,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(J LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_stop(this_arg_conv); @@ -32264,6 +38000,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jcl LDKInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Invoice_free(this_obj_conv); } @@ -32271,21 +38008,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq(JNIEnv *env, j LDKInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Invoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) { + LDKInvoice ret_var = Invoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Invoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoice ret_var = Invoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32297,6 +38059,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free(JNIEnv LDKSignedRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); SignedRawInvoice_free(this_obj_conv); } @@ -32304,21 +38067,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq(JNIEn LDKSignedRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSignedRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = SignedRawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) { + LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSignedRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = SignedRawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSignedRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32330,6 +38118,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1free(JNIEnv *env, LDKRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawInvoice_free(this_obj_conv); } @@ -32337,10 +38126,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1get_1data(JNIEn LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32352,9 +38143,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data(JNIEnv * LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RawDataPart_clone(&val_conv); RawInvoice_set_data(&this_ptr_conv, val_conv); } @@ -32363,21 +38156,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq(JNIEnv *env LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) { + LDKRawInvoice ret_var = RawInvoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32389,6 +38207,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1free(JNIEnv *env, LDKRawDataPart this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawDataPart_free(this_obj_conv); } @@ -32396,10 +38215,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1get_1timestamp LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32411,9 +38232,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp(JN LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = PositiveTimestamp_clone(&val_conv); RawDataPart_set_timestamp(&this_ptr_conv, val_conv); } @@ -32422,21 +38245,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq(JNIEnv *en LDKRawDataPart a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawDataPart b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawDataPart_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) { + LDKRawDataPart ret_var = RawDataPart_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRawDataPart arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawDataPart_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRawDataPart orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32448,6 +38296,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free(JNIEnv LDKPositiveTimestamp this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PositiveTimestamp_free(this_obj_conv); } @@ -32455,21 +38304,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq(JNIE LDKPositiveTimestamp a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPositiveTimestamp b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PositiveTimestamp_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) { + LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPositiveTimestamp arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PositiveTimestamp_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPositiveTimestamp orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32564,17 +38438,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free(JNIEnv *env, jcla LDKSha256 this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Sha256_free(this_obj_conv); } +static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) { + LDKSha256 ret_var = Sha256_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSha256 arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Sha256_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSha256 orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSha256 ret_var = Sha256_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32586,6 +38484,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1hash(JNIEnv *env, j LDKSha256 o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Sha256_hash(&o_conv); return ret_val; } @@ -32594,9 +38493,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq(JNIEnv *env, jc LDKSha256 a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSha256 b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Sha256_eq(&a_conv, &b_conv); return ret_val; } @@ -32605,17 +38506,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free(JNIEnv *env, LDKDescription this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Description_free(this_obj_conv); } +static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) { + LDKDescription ret_var = Description_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDescription arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Description_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDescription orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDescription ret_var = Description_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32627,6 +38552,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1hash(JNIEnv *e LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Description_hash(&o_conv); return ret_val; } @@ -32635,9 +38561,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Description_1eq(JNIEnv *en LDKDescription a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKDescription b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Description_eq(&a_conv, &b_conv); return ret_val; } @@ -32646,6 +38574,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free(JNIEnv *env, LDKPayeePubKey this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PayeePubKey_free(this_obj_conv); } @@ -32653,6 +38582,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNI LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form); return ret_arr; @@ -32662,6 +38592,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *en LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -32676,6 +38607,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *en uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32683,14 +38615,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *en return ret_ref; } +static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) { + LDKPayeePubKey ret_var = PayeePubKey_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPayeePubKey arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PayeePubKey_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPayeePubKey orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32702,6 +38657,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1hash(JNIEnv *e LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PayeePubKey_hash(&o_conv); return ret_val; } @@ -32710,9 +38666,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq(JNIEnv *en LDKPayeePubKey a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayeePubKey b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PayeePubKey_eq(&a_conv, &b_conv); return ret_val; } @@ -32721,17 +38679,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free(JNIEnv *env, LDKExpiryTime this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ExpiryTime_free(this_obj_conv); } +static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) { + LDKExpiryTime ret_var = ExpiryTime_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKExpiryTime arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ExpiryTime_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKExpiryTime orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32743,6 +38725,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1hash(JNIEnv *en LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ExpiryTime_hash(&o_conv); return ret_val; } @@ -32751,9 +38734,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1eq(JNIEnv *env LDKExpiryTime a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKExpiryTime b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ExpiryTime_eq(&a_conv, &b_conv); return ret_val; } @@ -32762,6 +38747,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1free(JNIEn LDKMinFinalCltvExpiry this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MinFinalCltvExpiry_free(this_obj_conv); } @@ -32769,6 +38755,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a( LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv); return ret_val; } @@ -32777,6 +38764,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a(JNI LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); MinFinalCltvExpiry_set_a(&this_ptr_conv, val); } @@ -32785,6 +38773,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNI uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32792,14 +38781,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNI return ret_ref; } +static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) { + LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMinFinalCltvExpiry arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MinFinalCltvExpiry_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMinFinalCltvExpiry orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32811,6 +38823,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1hash(JN LDKMinFinalCltvExpiry o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MinFinalCltvExpiry_hash(&o_conv); return ret_val; } @@ -32819,9 +38832,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1eq(JNI LDKMinFinalCltvExpiry a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMinFinalCltvExpiry b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MinFinalCltvExpiry_eq(&a_conv, &b_conv); return ret_val; } @@ -32835,6 +38850,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jc Fallback_free(this_ptr_conv); } +static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) { + LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); + *ret_copy = Fallback_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFallback* arg_conv = (LDKFallback*)arg; + int64_t ret_val = Fallback_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFallback* orig_conv = (LDKFallback*)orig; LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); @@ -32892,17 +38919,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free(JNIEnv LDKInvoiceSignature this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceSignature_free(this_obj_conv); } +static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) { + LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceSignature arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceSignature_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoiceSignature orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32914,9 +38965,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq(JNIEn LDKInvoiceSignature a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceSignature b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceSignature_eq(&a_conv, &b_conv); return ret_val; } @@ -32925,17 +38978,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free(JNIEnv *env LDKPrivateRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PrivateRoute_free(this_obj_conv); } +static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) { + LDKPrivateRoute ret_var = PrivateRoute_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPrivateRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PrivateRoute_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPrivateRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32947,6 +39024,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1hash(JNIEnv * LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PrivateRoute_hash(&o_conv); return ret_val; } @@ -32955,9 +39033,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1eq(JNIEnv *e LDKPrivateRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPrivateRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PrivateRoute_eq(&a_conv, &b_conv); return ret_val; } @@ -32966,6 +39046,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1into_1par LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = SignedRawInvoice_clone(&this_arg_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = SignedRawInvoice_into_parts(this_arg_conv); @@ -32976,10 +39057,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1raw_1invo LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32991,6 +39074,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1hash( LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SignedRawInvoice_hash(&this_arg_conv)); return ret_arr; @@ -33000,10 +39084,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signature LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33015,6 +39101,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1recover_1 LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv); return (uint64_t)ret_conv; @@ -33024,6 +39111,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1check_1s LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = SignedRawInvoice_check_signature(&this_arg_conv); return ret_val; } @@ -33032,6 +39120,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1hash(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_hash(&this_arg_conv).data); return ret_arr; @@ -33041,11 +39130,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1hash(J LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33058,11 +39149,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description(JNI LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDescription ret_var = RawInvoice_description(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33075,11 +39168,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payee_1pub_1key LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33092,11 +39187,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description_1ha LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33109,11 +39206,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1expiry_1time(JN LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33126,11 +39225,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1min_1final_1clt LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33143,6 +39244,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1se LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_payment_secret(&this_arg_conv).data); return ret_arr; @@ -33152,11 +39254,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1features(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33169,6 +39273,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1r LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33178,6 +39283,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1r uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -33193,6 +39299,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1amount_1pico_1b LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -33203,6 +39310,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RawInvoice_1currency(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jclass ret_conv = LDKCurrency_to_java(env, RawInvoice_currency(&this_arg_conv)); return ret_conv; } @@ -33223,6 +39331,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1unix LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_unix_timestamp(&this_arg_conv); return ret_val; } @@ -33231,6 +39340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1time LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_time(&this_arg_conv); return ret_val; } @@ -33239,11 +39349,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1into_1signed_1raw( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Invoice_clone(&this_arg_conv); LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33255,6 +39367,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1check_1signature(J LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); *ret_conv = Invoice_check_signature(&this_arg_conv); return (uint64_t)ret_conv; @@ -33264,6 +39377,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1signed(JNIEn LDKSignedRawInvoice signed_invoice_conv; signed_invoice_conv.inner = (void*)(signed_invoice & (~1)); signed_invoice_conv.is_owned = (signed_invoice & 1) || (signed_invoice == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv); signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = Invoice_from_signed(signed_invoice_conv); @@ -33274,6 +39388,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1timestamp(JNIEnv * LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_timestamp(&this_arg_conv); return ret_val; } @@ -33282,6 +39397,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1hash( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_hash(&this_arg_conv)); return ret_arr; @@ -33291,6 +39407,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payee_1pub_1ke LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_payee_pub_key(&this_arg_conv).compressed_form); return ret_arr; @@ -33300,6 +39417,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1secre LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv)); return ret_arr; @@ -33309,11 +39427,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1features(JNIEnv *e LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33326,6 +39446,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1recover_1payee LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form); return ret_arr; @@ -33335,6 +39456,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time(JNIEn LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_expiry_time(&this_arg_conv); return ret_val; } @@ -33343,6 +39465,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEn LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = Invoice_is_expired(&this_arg_conv); return ret_val; } @@ -33351,6 +39474,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1 LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_min_final_cltv_expiry(&this_arg_conv); return ret_val; } @@ -33359,6 +39483,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1rout LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33368,6 +39493,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1rout uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -33383,6 +39509,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33392,6 +39519,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints( uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -33407,6 +39535,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Invoice_1currency(JNIEnv *en LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jclass ret_conv = LDKCurrency_to_java(env, Invoice_currency(&this_arg_conv)); return ret_conv; } @@ -33415,6 +39544,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1sat LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -33432,6 +39562,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JN LDKDescription this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Description_clone(&this_arg_conv); LDKStr ret_str = Description_into_inner(this_arg_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); @@ -33455,6 +39586,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1seconds(JNI LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_seconds(&this_arg_conv); return ret_val; } @@ -33463,6 +39595,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1duration(JN LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_duration(&this_arg_conv); return ret_val; } @@ -33471,6 +39604,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1new(JNIEnv *e LDKRouteHint hops_conv; hops_conv.inner = (void*)(hops & (~1)); hops_conv.is_owned = (hops & 1) || (hops == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv); hops_conv = RouteHint_clone(&hops_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = PrivateRoute_new(hops_conv); @@ -33481,11 +39615,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner(J LDKPrivateRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = PrivateRoute_clone(&this_arg_conv); LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33614,6 +39750,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIE SignOrCreationError_free(this_ptr_conv); } +static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) { + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = SignOrCreationError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)arg; + int64_t ret_val = SignOrCreationError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)orig; LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); @@ -33656,6 +39804,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free(JNIEnv *env LDKInvoicePayer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoicePayer_free(this_obj_conv); } @@ -33681,6 +39830,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free(JNIEnv *en LDKRetryAttempts this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RetryAttempts_free(this_obj_conv); } @@ -33688,6 +39838,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a(JNIEn LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv); return ret_val; } @@ -33696,6 +39847,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a(JNIEnv * LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RetryAttempts_set_a(&this_ptr_conv, val); } @@ -33704,6 +39856,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33711,14 +39864,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv * return ret_ref; } +static inline uint64_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg) { + LDKRetryAttempts ret_var = RetryAttempts_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRetryAttempts arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RetryAttempts_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRetryAttempts orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRetryAttempts ret_var = RetryAttempts_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33730,9 +39906,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1eq(JNIEnv * LDKRetryAttempts a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRetryAttempts b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv); return ret_val; } @@ -33741,6 +39919,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash(JNIEnv LDKRetryAttempts o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RetryAttempts_hash(&o_conv); return ret_val; } @@ -33754,6 +39933,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free(JNIEnv *env PaymentError_free(this_ptr_conv); } +static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) { + LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); + *ret_copy = PaymentError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentError* arg_conv = (LDKPaymentError*)arg; + int64_t ret_val = PaymentError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentError* orig_conv = (LDKPaymentError*)orig; LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); @@ -33774,6 +39965,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing(JNIEn LDKLightningError a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = LightningError_clone(&a_conv); LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); *ret_copy = PaymentError_routing(a_conv); @@ -33810,6 +40002,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e LDKLockableScore scorer_conv; scorer_conv.inner = (void*)(scorer & (~1)); scorer_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -33827,11 +40020,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e LDKRetryAttempts retry_attempts_conv; retry_attempts_conv.inner = (void*)(retry_attempts & (~1)); retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_attempts_conv); retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv); LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33843,9 +40038,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice( LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv); return (uint64_t)ret_conv; @@ -33855,9 +40052,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1va LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats); return (uint64_t)ret_conv; @@ -33867,6 +40066,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1 LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); @@ -33878,6 +40078,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHand LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -33887,6 +40088,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -33909,6 +40111,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *en LDKDefaultRouter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DefaultRouter_free(this_obj_conv); } @@ -33916,6 +40119,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv * LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -33927,6 +40131,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv * uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33938,6 +40143,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(J LDKDefaultRouter this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); *ret_ret = DefaultRouter_as_Router(&this_arg_conv); return (uint64_t)ret_ret; @@ -33947,6 +40153,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(J LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer"); *ret_ret = ChannelManager_as_Payer(&this_arg_conv); return (uint64_t)ret_ret; @@ -33977,6 +40184,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *en LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = Invoice_to_str(&o_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -33987,6 +40195,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(J LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = SignedRawInvoice_to_str(&o_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index bef74b1b..450eae03 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -135,14 +135,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec (JNIEnv *, jclass); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_u8Z_new - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1new - (JNIEnv *, jclass, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: TxOut_get_script_pubkey @@ -159,14 +151,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1script_1pubk JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1value (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_SecretKeyErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_SecretKeyErrorZ_get_ok @@ -183,14 +167,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErr JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PublicKeyErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PublicKeyErrorZ_get_ok @@ -207,14 +183,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErr JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxCreationKeysDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_TxCreationKeysDecodeErrorZ_get_ok @@ -231,14 +199,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ChannelPublicKeysDecodeErrorZ_get_ok @@ -255,14 +215,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeys JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxCreationKeysErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_TxCreationKeysErrorZ_get_ok @@ -287,14 +239,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysE JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok @@ -311,14 +255,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommi JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok @@ -335,14 +271,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChann JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_ok @@ -359,14 +287,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactio JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_ok @@ -383,14 +303,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentT JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok @@ -407,14 +319,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TrustedClosingTransactionNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_TrustedClosingTransactionNoneZ_get_ok @@ -431,14 +335,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTra JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok @@ -455,14 +351,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransac JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok @@ -479,14 +367,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitment JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_SignatureZNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_CVec_SignatureZNoneZ_get_ok @@ -503,14 +383,6 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1Sign JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ShutdownScriptDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ShutdownScriptDecodeErrorZ_get_ok @@ -527,14 +399,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_ok @@ -551,14 +415,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInv JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NoneErrorZ_get_ok @@ -575,14 +431,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_1o JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteHopDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RouteHopDecodeErrorZ_get_ok @@ -599,22 +447,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_RouteHopZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RouteDecodeErrorZ_get_ok @@ -631,14 +463,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteParametersDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RouteParametersDecodeErrorZ_get_ok @@ -655,14 +479,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDe JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_RouteHintZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: LDKCOption_u64Z_ref_from_ptr @@ -671,14 +487,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PayeeDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PayeeDecodeErrorZ_get_ok @@ -695,22 +503,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_RouteHintHopZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintHopZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteHintDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RouteHintDecodeErrorZ_get_ok @@ -727,14 +519,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteHintHopDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RouteHintHopDecodeErrorZ_get_ok @@ -751,22 +535,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_ChannelDetailsZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RouteLightningErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RouteLightningErrorZ_get_ok @@ -783,14 +551,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TxOutAccessErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_TxOutAccessErrorZ_get_ok @@ -823,22 +583,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1g JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_C2Tuple_usizeTransactionZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok @@ -863,14 +607,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMoni JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_MonitorEventZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr @@ -881,210 +617,210 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeT /* * Class: org_ldk_impl_bindings - * Method: LDKNetworkUpdate_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKNetworkUpdate; + * Method: LDKClosureReason_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKClosureReason; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCOption_NetworkUpdateZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_NetworkUpdateZ; + * Method: LDKCOption_ClosureReasonZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_ClosureReasonZ; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetworkUpdateZ_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKSpendableOutputDescriptor_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKSpendableOutputDescriptor; + * Method: LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVec_SpendableOutputDescriptorZ_new - * Signature: ([J)J + * Method: LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKErrorAction_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKErrorAction; + * Method: LDKNetworkUpdate_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKNetworkUpdate; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKMessageSendEvent_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEvent; + * Method: LDKCOption_NetworkUpdateZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_NetworkUpdateZ; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetworkUpdateZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVec_MessageSendEventZ_new - * Signature: ([J)J + * Method: LDKSpendableOutputDescriptor_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKSpendableOutputDescriptor; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_InitFeaturesDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKPaymentPurpose_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentPurpose; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1result_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_InitFeaturesDecodeErrorZ_get_ok - * Signature: (J)J + * Method: LDKEvent_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKEvent; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_InitFeaturesDecodeErrorZ_get_err - * Signature: (J)J + * Method: LDKCOption_EventZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_EventZ; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeFeaturesDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCResult_COption_EventZDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1result_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeFeaturesDecodeErrorZ_get_ok + * Method: LDKCResult_COption_EventZDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeFeaturesDecodeErrorZ_get_err - * Signature: (J)J + * Method: LDKErrorAction_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKErrorAction; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKMessageSendEvent_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEvent; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1result_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok + * Method: LDKCResult_InitFeaturesDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelFeaturesDecodeErrorZ_get_err + * Method: LDKCResult_InitFeaturesDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCResult_NodeFeaturesDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok + * Method: LDKCResult_NodeFeaturesDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err + * Method: LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ScoringParametersDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCResult_ChannelFeaturesDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1result_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_ok + * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_err + * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ScorerDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1result_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ScorerDecodeErrorZ_get_ok + * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_ScorerDecodeErrorZ_get_err + * Method: LDKCResult_ScorerDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCResult_ScorerDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1result_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -1103,14 +839,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOut JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok @@ -1127,14 +855,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutp JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok @@ -1151,14 +871,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDe JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NoneNoneZ_get_ok @@ -1191,14 +903,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok @@ -1215,14 +919,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1Signatur JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_SignatureNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_SignatureNoneZ_get_ok @@ -1383,14 +1079,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSign_1get_1BaseSign JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Sign_1write (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_SignDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_SignDecodeErrorZ_get_ok @@ -1407,14 +1095,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RecoverableSignatureNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RecoverableSignatureNoneZ_get_ok @@ -1431,14 +1111,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableS JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok @@ -1455,14 +1127,6 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_InMemorySignerDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_InMemorySignerDecodeErrorZ_get_ok @@ -1479,22 +1143,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_TxOutZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_TransactionNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_TransactionNoneZ_get_ok @@ -1527,22 +1175,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChanne JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_C2Tuple_BlockHashChannelMonitorZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1BlockHashChannelMonitorZZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok @@ -1575,14 +1207,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u16Z_1ref_1from JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneAPIErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NoneAPIErrorZ_get_ok @@ -1599,30 +1223,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_CResult_NoneAPIErrorZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CResult_1NoneAPIErrorZZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_APIErrorZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1APIErrorZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult__u832APIErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult__u832APIErrorZ_get_ok @@ -1647,14 +1247,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PaymentIdPaymentSendFailureZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PaymentIdPaymentSendFailureZ_get_ok @@ -1671,14 +1263,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPay JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NonePaymentSendFailureZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NonePaymentSendFailureZ_get_ok @@ -1711,14 +1295,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaym JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok @@ -1743,14 +1319,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentH JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_NetAddressZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: C2Tuple_PaymentHashPaymentSecretZ_get_a @@ -1767,14 +1335,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaym JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PaymentSecretAPIErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PaymentSecretAPIErrorZ_get_ok @@ -1791,14 +1351,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecre JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_ChannelMonitorZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: LDKWatch_new @@ -1951,14 +1503,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChanne JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok @@ -1975,14 +1519,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHas JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelConfigDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ChannelConfigDecodeErrorZ_get_ok @@ -1999,14 +1535,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_OutPointDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_OutPointDecodeErrorZ_get_ok @@ -2063,14 +1591,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Type_1write JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_COption_TypeZDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_COption_TypeZDecodeErrorZ_get_ok @@ -2095,14 +1615,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDec JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PaymentIdPaymentErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PaymentIdPaymentErrorZ_get_ok @@ -2119,14 +1631,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPay JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_SiPrefixNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_SiPrefixNoneZ_get_ok @@ -2143,14 +1647,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_InvoiceNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_InvoiceNoneZ_get_ok @@ -2167,14 +1663,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_SignedRawInvoiceNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_SignedRawInvoiceNoneZ_get_ok @@ -2215,14 +1703,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u83 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PayeePubKeyErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PayeePubKeyErrorZ_get_ok @@ -2239,22 +1719,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_PrivateRouteZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1PrivateRouteZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PositiveTimestampCreationErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PositiveTimestampCreationErrorZ_get_ok @@ -2271,14 +1735,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestamp JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneSemanticErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NoneSemanticErrorZ_get_ok @@ -2295,14 +1751,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_InvoiceSemanticErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_InvoiceSemanticErrorZ_get_ok @@ -2319,14 +1767,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticEr JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_DescriptionCreationErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_DescriptionCreationErrorZ_get_ok @@ -2343,14 +1783,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreati JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ExpiryTimeCreationErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ExpiryTimeCreationErrorZ_get_ok @@ -2367,14 +1799,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreatio JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PrivateRouteCreationErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PrivateRouteCreationErrorZ_get_ok @@ -2391,14 +1815,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreat JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_StringErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_StringErrorZ_get_ok @@ -2415,14 +1831,6 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1g JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok @@ -2441,34 +1849,42 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpd /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_HTLCUpdateDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCOption_MonitorEventZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_MonitorEventZ; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1result_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_HTLCUpdateDecodeErrorZ_get_ok + * Method: LDKCResult_COption_MonitorEventZDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_HTLCUpdateDecodeErrorZ_get_err + * Method: LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneMonitorUpdateErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCResult_HTLCUpdateDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCResult_HTLCUpdateDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -2519,14 +1935,6 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_C2Tuple_u32ScriptZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32ScriptZZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a @@ -2543,46 +1951,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tup JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKPaymentPurpose_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentPurpose; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKClosureReason_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKClosureReason; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKEvent_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKEvent; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_EventZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: C2Tuple_u32TxOutZ_get_a @@ -2599,14 +1967,6 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_C2Tuple_u32TxOutZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a @@ -2623,14 +1983,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tup JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: LDKBalance_ref_from_ptr @@ -2639,22 +1991,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_BalanceZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1BalanceZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok @@ -2671,14 +2007,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHas JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NoneLightningErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NoneLightningErrorZ_get_ok @@ -2711,22 +2039,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_C2Tuple_PublicKeyTypeZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1PublicKeyTypeZZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolLightningErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_boolLightningErrorZ_get_ok @@ -2767,30 +2079,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementC JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_NodeAnnouncementZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok @@ -2807,14 +2095,6 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPee JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NonePeerHandleErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NonePeerHandleErrorZ_get_ok @@ -2833,50 +2113,50 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErr /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolPeerHandleErrorZ_result_ok + * Method: LDKCResult_boolPeerHandleErrorZ_get_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolPeerHandleErrorZ_get_ok - * Signature: (J)Z + * Method: LDKCResult_boolPeerHandleErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_boolPeerHandleErrorZ_get_err + * Method: LDKCResult_NodeIdDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeIdDecodeErrorZ_result_ok - * Signature: (J)Z + * Method: LDKCResult_NodeIdDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1result_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeIdDecodeErrorZ_get_ok + * Method: LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeIdDecodeErrorZ_get_err + * Method: LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -2903,14 +2183,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok @@ -2927,14 +2199,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChanne JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelInfoDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ChannelInfoDecodeErrorZ_get_ok @@ -2951,14 +2215,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RoutingFeesDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RoutingFeesDecodeErrorZ_get_ok @@ -2975,14 +2231,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok @@ -2999,22 +2247,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementI JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_u64Z_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeInfoDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NodeInfoDecodeErrorZ_get_ok @@ -3031,14 +2263,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NetworkGraphDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NetworkGraphDecodeErrorZ_get_ok @@ -3063,14 +2287,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecod JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NetAddressDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NetAddressDecodeErrorZ_get_ok @@ -3089,92 +2305,36 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeE /* * Class: org_ldk_impl_bindings - * Method: LDKCVec_UpdateAddHTLCZ_new - * Signature: ([J)J + * Method: LDKCResult_AcceptChannelDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVec_UpdateFulfillHTLCZ_new - * Signature: ([J)J + * Method: LDKCResult_AcceptChannelDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVec_UpdateFailHTLCZ_new - * Signature: ([J)J + * Method: LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1new - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCVec_UpdateFailMalformedHTLCZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1new - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_AcceptChannelDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_AcceptChannelDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_AcceptChannelDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_err - * Signature: (J)J + * Method: LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_err + * Signature: (J)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelReestablishDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ChannelReestablishDecodeErrorZ_get_ok @@ -3191,14 +2351,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablis JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ClosingSignedDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ClosingSignedDecodeErrorZ_get_ok @@ -3215,14 +2367,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok @@ -3239,14 +2383,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeR JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_CommitmentSignedDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_CommitmentSignedDecodeErrorZ_get_ok @@ -3263,14 +2399,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedD JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_FundingCreatedDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_FundingCreatedDecodeErrorZ_get_ok @@ -3287,14 +2415,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_FundingSignedDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_FundingSignedDecodeErrorZ_get_ok @@ -3311,14 +2431,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_FundingLockedDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_FundingLockedDecodeErrorZ_get_ok @@ -3335,14 +2447,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_InitDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_InitDecodeErrorZ_get_ok @@ -3359,14 +2463,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_OpenChannelDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_OpenChannelDecodeErrorZ_get_ok @@ -3383,14 +2479,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_RevokeAndACKDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_RevokeAndACKDecodeErrorZ_get_ok @@ -3407,14 +2495,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ShutdownDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ShutdownDecodeErrorZ_get_ok @@ -3431,14 +2511,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_UpdateFailHTLCDecodeErrorZ_get_ok @@ -3455,14 +2527,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok @@ -3479,14 +2543,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalform JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_UpdateFeeDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_UpdateFeeDecodeErrorZ_get_ok @@ -3503,14 +2559,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_ok @@ -3527,14 +2575,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLC JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_UpdateAddHTLCDecodeErrorZ_get_ok @@ -3551,14 +2591,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PingDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PingDecodeErrorZ_get_ok @@ -3575,14 +2607,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_PongDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_PongDecodeErrorZ_get_ok @@ -3599,14 +2623,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok @@ -3623,14 +2639,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAn JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ChannelAnnouncementDecodeErrorZ_get_ok @@ -3647,14 +2655,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounceme JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok @@ -3671,14 +2671,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUp JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ChannelUpdateDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ChannelUpdateDecodeErrorZ_get_ok @@ -3695,14 +2687,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ErrorMessageDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ErrorMessageDecodeErrorZ_get_ok @@ -3719,14 +2703,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok @@ -3743,14 +2719,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnou JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NodeAnnouncementDecodeErrorZ_get_ok @@ -3767,14 +2735,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementD JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok @@ -3791,14 +2751,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannel JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok @@ -3815,14 +2767,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannel JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok @@ -3839,14 +2783,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRange JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok @@ -3863,14 +2799,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRange JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok @@ -3895,14 +2823,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFi JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_InvoiceSignOrCreationErrorZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_InvoiceSignOrCreationErrorZ_get_ok @@ -3951,14 +2871,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCResult_LockedChannelMonitorNoneZ_result_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1result_1ok - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCResult_LockedChannelMonitorNoneZ_get_ok @@ -3975,14 +2887,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMoni JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCVec_OutPointZ_new - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1OutPointZ_1new - (JNIEnv *, jclass, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: LDKMessageSendEventsProvider_new @@ -4623,6 +3527,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1new JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: TxOut_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: TxOut_clone @@ -4655,6 +3567,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SecretKeyErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SecretKeyErrorZ_free @@ -4681,12 +3601,28 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err /* * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_free - * Signature: (J)V + * Method: CResult_PublicKeyErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PublicKeyErrorZ_free + * Signature: (J)V */ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PublicKeyErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PublicKeyErrorZ_clone @@ -4711,6 +3647,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxCreationKeysDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TxCreationKeysDecodeErrorZ_free @@ -4719,6 +3663,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecode JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxCreationKeysDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TxCreationKeysDecodeErrorZ_clone @@ -4743,6 +3695,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelPublicKeysDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelPublicKeysDecodeErrorZ_free @@ -4751,6 +3711,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDec JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelPublicKeysDecodeErrorZ_clone @@ -4775,6 +3743,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxCreationKeysErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TxCreationKeysErrorZ_free @@ -4783,6 +3759,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxCreationKeysErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TxCreationKeysErrorZ_clone @@ -4815,6 +3799,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_u32Z_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_u32Z_clone @@ -4839,6 +3831,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitme JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_free @@ -4847,6 +3847,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitme JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_clone @@ -4871,6 +3879,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelT JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free @@ -4879,6 +3895,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelT JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone @@ -4903,6 +3927,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionPa JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTransactionParametersDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelTransactionParametersDecodeErrorZ_free @@ -4911,6 +3943,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionPa JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelTransactionParametersDecodeErrorZ_clone @@ -4943,6 +3983,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTran JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_HolderCommitmentTransactionDecodeErrorZ_free @@ -4951,6 +3999,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTran JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_HolderCommitmentTransactionDecodeErrorZ_clone @@ -4975,6 +4031,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTrans JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_BuiltCommitmentTransactionDecodeErrorZ_free @@ -4983,6 +4047,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTrans JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_BuiltCommitmentTransactionDecodeErrorZ_clone @@ -5007,6 +4079,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransa JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TrustedClosingTransactionNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TrustedClosingTransactionNoneZ_free @@ -5031,6 +4111,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactio JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentTransactionDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CommitmentTransactionDecodeErrorZ_free @@ -5039,6 +4127,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactio JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentTransactionDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CommitmentTransactionDecodeErrorZ_clone @@ -5063,6 +4159,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTra JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TrustedCommitmentTransactionNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TrustedCommitmentTransactionNoneZ_free @@ -5087,6 +4191,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_SignatureZNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_SignatureZNoneZ_free @@ -5095,6 +4207,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_SignatureZNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_SignatureZNoneZ_clone @@ -5119,6 +4239,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ShutdownScriptDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ShutdownScriptDecodeErrorZ_free @@ -5127,6 +4255,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecode JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ShutdownScriptDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ShutdownScriptDecodeErrorZ_clone @@ -5151,6 +4287,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvali JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ShutdownScriptInvalidShutdownScriptZ_free @@ -5159,6 +4303,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvali JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ShutdownScriptInvalidShutdownScriptZ_clone @@ -5183,6 +4335,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneErrorZ_free @@ -5191,6 +4351,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneErrorZ_clone @@ -5215,6 +4383,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHopDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteHopDecodeErrorZ_free @@ -5223,6 +4399,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHopDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteHopDecodeErrorZ_clone @@ -5263,6 +4447,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1o JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteDecodeErrorZ_free @@ -5271,6 +4463,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1e JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteDecodeErrorZ_clone @@ -5295,6 +4495,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteParametersDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteParametersDecodeErrorZ_free @@ -5303,6 +4511,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecod JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteParametersDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteParametersDecodeErrorZ_clone @@ -5343,6 +4559,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_u64Z_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_u64Z_clone @@ -5367,6 +4591,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1o JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PayeeDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PayeeDecodeErrorZ_free @@ -5375,6 +4607,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1e JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PayeeDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PayeeDecodeErrorZ_clone @@ -5407,6 +4647,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeError JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteHintDecodeErrorZ_free @@ -5415,6 +4663,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeError JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteHintDecodeErrorZ_clone @@ -5441,12 +4697,28 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeEr /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintHopDecodeErrorZ_free - * Signature: (J)V + * Method: CResult_RouteHintHopDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintHopDecodeErrorZ_free + * Signature: (J)V */ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintHopDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteHintHopDecodeErrorZ_clone @@ -5479,6 +4751,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteLightningErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteLightningErrorZ_free @@ -5487,6 +4767,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteLightningErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteLightningErrorZ_clone @@ -5511,6 +4799,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1o JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxOutAccessErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TxOutAccessErrorZ_free @@ -5519,6 +4815,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1e JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxOutAccessErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TxOutAccessErrorZ_clone @@ -5527,6 +4831,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1fr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_usizeTransactionZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_usizeTransactionZ_clone @@ -5583,6 +4895,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUp JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneChannelMonitorUpdateErrZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneChannelMonitorUpdateErrZ_free @@ -5591,6 +4911,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUp JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneChannelMonitorUpdateErrZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneChannelMonitorUpdateErrZ_clone @@ -5631,6 +4959,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransa JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_C2Tuple_usizeTransactionZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_C2Tuple_usizeTransactionZZ_clone @@ -5639,6 +4975,94 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransac JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_ClosureReasonZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_ClosureReasonZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_ClosureReasonZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_ClosureReasonZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_ClosureReasonZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_NetworkUpdateZ_some @@ -5663,6 +5087,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_NetworkUpdateZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_NetworkUpdateZ_clone @@ -5679,6 +5111,94 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clon JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: COption_EventZ_some + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_EventZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_EventZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_EventZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_EventZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_EventZDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_EventZDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_EventZDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_EventZDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_EventZDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_EventZDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CVec_MessageSendEventZ_free @@ -5703,6 +5223,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InitFeaturesDecodeErrorZ_free @@ -5727,6 +5255,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeFeaturesDecodeErrorZ_free @@ -5751,6 +5287,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelFeaturesDecodeErrorZ_free @@ -5775,6 +5319,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceFeaturesDecodeErrorZ_free @@ -5799,6 +5351,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ScoringParametersDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ScoringParametersDecodeErrorZ_free @@ -5823,6 +5383,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ScorerDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ScorerDecodeErrorZ_free @@ -5847,6 +5415,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutput JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free @@ -5855,6 +5431,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutput JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone @@ -5879,6 +5463,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputD JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free @@ -5889,15 +5481,23 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDe /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_ok + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_ok * Signature: (J)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok @@ -5911,6 +5511,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_free @@ -5919,6 +5527,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescr JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_clone @@ -5943,6 +5559,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneNoneZ_free @@ -5951,6 +5575,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneNoneZ_clone @@ -5959,6 +5591,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_SignatureCVec_SignatureZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_SignatureCVec_SignatureZZ_clone @@ -5999,6 +5639,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCV JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free @@ -6007,6 +5655,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCV JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone @@ -6031,6 +5687,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignatureNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SignatureNoneZ_free @@ -6039,6 +5703,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignatureNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SignatureNoneZ_clone @@ -6063,6 +5735,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SignDecodeErrorZ_free @@ -6071,6 +5751,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1er JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SignDecodeErrorZ_clone @@ -6103,6 +5791,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignature JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RecoverableSignatureNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RecoverableSignatureNoneZ_free @@ -6111,6 +5807,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignature JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RecoverableSignatureNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RecoverableSignatureNoneZ_clone @@ -6143,6 +5847,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_CVec_u8ZZNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_CVec_u8ZZNoneZ_free @@ -6151,6 +5863,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_CVec_u8ZZNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_CVec_u8ZZNoneZ_clone @@ -6175,6 +5895,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InMemorySignerDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InMemorySignerDecodeErrorZ_free @@ -6183,6 +5911,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecode JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InMemorySignerDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InMemorySignerDecodeErrorZ_clone @@ -6215,6 +5951,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TransactionNoneZ_free @@ -6223,6 +5967,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1er JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TransactionNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_TransactionNoneZ_clone @@ -6231,6 +5983,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1fre JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_BlockHashChannelMonitorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_BlockHashChannelMonitorZ_clone @@ -6279,6 +6039,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1Block JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free @@ -6287,6 +6055,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1Block JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone @@ -6319,6 +6095,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_u16Z_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_u16Z_clone @@ -6343,6 +6127,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneAPIErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneAPIErrorZ_free @@ -6351,6 +6143,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneAPIErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneAPIErrorZ_clone @@ -6391,6 +6191,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult__u832APIErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult__u832APIErrorZ_free @@ -6399,6 +6207,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult__u832APIErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult__u832APIErrorZ_clone @@ -6423,6 +6239,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSend JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PaymentIdPaymentSendFailureZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentIdPaymentSendFailureZ_free @@ -6431,6 +6255,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSend JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PaymentIdPaymentSendFailureZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentIdPaymentSendFailureZ_clone @@ -6455,6 +6287,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailu JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePaymentSendFailureZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NonePaymentSendFailureZ_free @@ -6463,6 +6303,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailu JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePaymentSendFailureZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NonePaymentSendFailureZ_clone @@ -6471,6 +6319,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailur JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PaymentHashPaymentIdZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_PaymentHashPaymentIdZ_clone @@ -6511,6 +6367,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHash JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free @@ -6519,6 +6383,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHash JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone @@ -6535,6 +6407,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHash JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PaymentHashPaymentSecretZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_PaymentHashPaymentSecretZ_clone @@ -6575,6 +6455,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErro JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PaymentSecretAPIErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentSecretAPIErrorZ_free @@ -6583,6 +6471,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErro JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PaymentSecretAPIErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentSecretAPIErrorZ_clone @@ -6631,6 +6527,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashCh JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free @@ -6655,6 +6559,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelConfigDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelConfigDecodeErrorZ_free @@ -6663,6 +6575,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelConfigDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelConfigDecodeErrorZ_clone @@ -6687,6 +6607,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OutPointDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_OutPointDecodeErrorZ_free @@ -6697,7 +6625,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_ /* * Class: org_ldk_impl_bindings - * Method: CResult_OutPointDecodeErrorZ_clone + * Method: CResult_OutPointDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OutPointDecodeErrorZ_clone * Signature: (J)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone @@ -6727,6 +6663,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_TypeZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_TypeZ_clone @@ -6751,6 +6695,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_TypeZDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_COption_TypeZDecodeErrorZ_free @@ -6759,6 +6711,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecode JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_TypeZDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_COption_TypeZDecodeErrorZ_clone @@ -6783,6 +6743,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErro JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PaymentIdPaymentErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentIdPaymentErrorZ_free @@ -6791,6 +6759,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErro JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PaymentIdPaymentErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentIdPaymentErrorZ_clone @@ -6815,6 +6791,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SiPrefixNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SiPrefixNoneZ_free @@ -6823,6 +6807,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1err JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SiPrefixNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SiPrefixNoneZ_clone @@ -6847,6 +6839,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceNoneZ_free @@ -6855,6 +6855,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1err JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceNoneZ_clone @@ -6879,6 +6887,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignedRawInvoiceNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SignedRawInvoiceNoneZ_free @@ -6887,6 +6903,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignedRawInvoiceNoneZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_SignedRawInvoiceNoneZ_clone @@ -6895,6 +6919,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone @@ -6935,6 +6967,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1o JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PayeePubKeyErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PayeePubKeyErrorZ_free @@ -6943,6 +6983,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1e JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PayeePubKeyErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PayeePubKeyErrorZ_clone @@ -6975,6 +7023,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCre JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PositiveTimestampCreationErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PositiveTimestampCreationErrorZ_free @@ -6983,6 +7039,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCre JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PositiveTimestampCreationErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PositiveTimestampCreationErrorZ_clone @@ -7007,6 +7071,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneSemanticErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneSemanticErrorZ_free @@ -7015,6 +7087,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneSemanticErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneSemanticErrorZ_clone @@ -7039,6 +7119,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticError JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceSemanticErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceSemanticErrorZ_free @@ -7047,6 +7135,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticError JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceSemanticErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceSemanticErrorZ_clone @@ -7071,6 +7167,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DescriptionCreationErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_DescriptionCreationErrorZ_free @@ -7079,6 +7183,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DescriptionCreationErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_DescriptionCreationErrorZ_clone @@ -7103,6 +7215,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1err (JNIEnv *, jclass, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ExpiryTimeCreationErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ExpiryTimeCreationErrorZ_free @@ -7111,100 +7231,236 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationEr JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ExpiryTimeCreationErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ExpiryTimeCreationErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_err + * Signature: (Lorg/ldk/enums/CreationError;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StringErrorZ_ok + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok + (JNIEnv *, jclass, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StringErrorZ_err + * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StringErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StringErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_ok + * Method: COption_MonitorEventZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_err - * Signature: (Lorg/ldk/enums/CreationError;)J + * Method: COption_MonitorEventZ_none + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_free + * Method: COption_MonitorEventZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_clone + * Method: COption_MonitorEventZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_ok - * Signature: (Ljava/lang/String;)J + * Method: COption_MonitorEventZ_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok - (JNIEnv *, jclass, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: CResult_COption_MonitorEventZDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_free - * Signature: (J)V + * Method: CResult_COption_MonitorEventZDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_COption_MonitorEventZDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_err - * Signature: (J)J + * Method: CResult_COption_MonitorEventZDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_free - * Signature: (J)V + * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone + * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -7223,6 +7479,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErro JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HTLCUpdateDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_HTLCUpdateDecodeErrorZ_free @@ -7231,6 +7495,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErro JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_HTLCUpdateDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_HTLCUpdateDecodeErrorZ_clone @@ -7255,6 +7527,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneMonitorUpdateErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneMonitorUpdateErrorZ_free @@ -7263,6 +7543,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErr JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneMonitorUpdateErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneMonitorUpdateErrorZ_clone @@ -7271,6 +7559,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErro JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointScriptZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_OutPointScriptZ_clone @@ -7295,6 +7591,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u32ScriptZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_u32ScriptZ_clone @@ -7327,6 +7631,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone @@ -7375,6 +7687,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free (JNIEnv *, jclass, jobjectArray); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u32TxOutZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_u32TxOutZ_clone @@ -7407,6 +7727,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone @@ -7463,6 +7791,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashCh JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free @@ -7471,6 +7807,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashCh JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone @@ -7495,6 +7839,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneLightningErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneLightningErrorZ_free @@ -7503,6 +7855,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneLightningErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NoneLightningErrorZ_clone @@ -7511,6 +7871,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PublicKeyTypeZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C2Tuple_PublicKeyTypeZ_clone @@ -7559,6 +7927,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolLightningErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_boolLightningErrorZ_free @@ -7567,6 +7943,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolLightningErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_boolLightningErrorZ_clone @@ -7575,6 +7959,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone @@ -7639,6 +8031,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_u8ZPeerHandleErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_u8ZPeerHandleErrorZ_free @@ -7647,6 +8047,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone @@ -7671,6 +8079,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePeerHandleErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NonePeerHandleErrorZ_free @@ -7679,6 +8095,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NonePeerHandleErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NonePeerHandleErrorZ_clone @@ -7703,6 +8127,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolPeerHandleErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_boolPeerHandleErrorZ_free @@ -7711,6 +8143,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolPeerHandleErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_boolPeerHandleErrorZ_clone @@ -7735,6 +8175,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeIdDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeIdDecodeErrorZ_free @@ -7743,6 +8191,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeIdDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeIdDecodeErrorZ_clone @@ -7751,6 +8207,54 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1f JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_AccessZ_some @@ -7791,6 +8295,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelIn JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DirectionalChannelInfoDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_DirectionalChannelInfoDecodeErrorZ_free @@ -7799,6 +8311,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelIn JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_DirectionalChannelInfoDecodeErrorZ_clone @@ -7825,10 +8345,26 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErr /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_free - * Signature: (J)V + * Method: CResult_ChannelInfoDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelInfoDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelInfoDecodeErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* @@ -7855,6 +8391,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RoutingFeesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RoutingFeesDecodeErrorZ_free @@ -7863,6 +8407,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErr JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RoutingFeesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RoutingFeesDecodeErrorZ_clone @@ -7887,6 +8439,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfo JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_free @@ -7895,6 +8455,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfo JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_clone @@ -7927,6 +8495,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeInfoDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeInfoDecodeErrorZ_free @@ -7935,6 +8511,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeInfoDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeInfoDecodeErrorZ_clone @@ -7959,6 +8543,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetworkGraphDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NetworkGraphDecodeErrorZ_free @@ -7967,6 +8559,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeEr JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetworkGraphDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NetworkGraphDecodeErrorZ_clone @@ -7999,6 +8599,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: COption_CVec_NetAddressZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: COption_CVec_NetAddressZZ_clone @@ -8023,6 +8631,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErro JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetAddressDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NetAddressDecodeErrorZ_free @@ -8031,6 +8647,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErro JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetAddressDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NetAddressDecodeErrorZ_clone @@ -8087,6 +8711,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AcceptChannelDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_AcceptChannelDecodeErrorZ_free @@ -8095,6 +8727,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AcceptChannelDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_AcceptChannelDecodeErrorZ_clone @@ -8119,6 +8759,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignatur JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AnnouncementSignaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_AnnouncementSignaturesDecodeErrorZ_free @@ -8127,6 +8775,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignatur JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_AnnouncementSignaturesDecodeErrorZ_clone @@ -8151,6 +8807,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDe JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelReestablishDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelReestablishDecodeErrorZ_free @@ -8159,6 +8823,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDe JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelReestablishDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelReestablishDecodeErrorZ_clone @@ -8183,6 +8855,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ClosingSignedDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ClosingSignedDecodeErrorZ_free @@ -8191,6 +8871,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ClosingSignedDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ClosingSignedDecodeErrorZ_clone @@ -8215,6 +8903,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRang JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ClosingSignedFeeRangeDecodeErrorZ_free @@ -8223,6 +8919,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRang JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ClosingSignedFeeRangeDecodeErrorZ_clone @@ -8247,6 +8951,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CommitmentSignedDecodeErrorZ_free @@ -8255,6 +8967,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDeco JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_CommitmentSignedDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_CommitmentSignedDecodeErrorZ_clone @@ -8279,6 +8999,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingCreatedDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_FundingCreatedDecodeErrorZ_free @@ -8287,6 +9015,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecode JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingCreatedDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_FundingCreatedDecodeErrorZ_clone @@ -8311,6 +9047,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingSignedDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_FundingSignedDecodeErrorZ_free @@ -8319,6 +9063,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingSignedDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_FundingSignedDecodeErrorZ_clone @@ -8343,6 +9095,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingLockedDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_FundingLockedDecodeErrorZ_free @@ -8351,6 +9111,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_FundingLockedDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_FundingLockedDecodeErrorZ_clone @@ -8375,6 +9143,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InitDecodeErrorZ_free @@ -8383,6 +9159,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1er JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InitDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InitDecodeErrorZ_clone @@ -8407,6 +9191,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OpenChannelDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_OpenChannelDecodeErrorZ_free @@ -8415,6 +9207,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErr JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OpenChannelDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_OpenChannelDecodeErrorZ_clone @@ -8439,6 +9239,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RevokeAndACKDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RevokeAndACKDecodeErrorZ_free @@ -8447,6 +9255,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeEr JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RevokeAndACKDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RevokeAndACKDecodeErrorZ_clone @@ -8471,6 +9287,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ShutdownDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ShutdownDecodeErrorZ_free @@ -8479,6 +9303,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ShutdownDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ShutdownDecodeErrorZ_clone @@ -8503,6 +9335,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecode JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateFailHTLCDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateFailHTLCDecodeErrorZ_free @@ -8511,6 +9351,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecode JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateFailHTLCDecodeErrorZ_clone @@ -8535,6 +9383,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedH JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateFailMalformedHTLCDecodeErrorZ_free @@ -8543,6 +9399,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedH JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone @@ -8564,7 +9428,15 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeError * Method: CResult_UpdateFeeDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateFeeDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* @@ -8575,6 +9447,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeError JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateFeeDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateFeeDecodeErrorZ_clone @@ -8599,6 +9479,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateFulfillHTLCDecodeErrorZ_free @@ -8607,6 +9495,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDec JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateFulfillHTLCDecodeErrorZ_clone @@ -8631,6 +9527,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateAddHTLCDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateAddHTLCDecodeErrorZ_free @@ -8639,6 +9543,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UpdateAddHTLCDecodeErrorZ_clone @@ -8663,6 +9575,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PingDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PingDecodeErrorZ_free @@ -8671,6 +9591,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1er JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PingDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PingDecodeErrorZ_clone @@ -8695,6 +9623,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1ok JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PongDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PongDecodeErrorZ_free @@ -8703,6 +9639,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1er JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PongDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_PongDecodeErrorZ_clone @@ -8727,6 +9671,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnou JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UnsignedChannelAnnouncementDecodeErrorZ_free @@ -8735,6 +9687,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnou JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone @@ -8759,6 +9719,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementD JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelAnnouncementDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelAnnouncementDecodeErrorZ_free @@ -8767,6 +9735,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementD JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelAnnouncementDecodeErrorZ_clone @@ -8791,6 +9767,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdat JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UnsignedChannelUpdateDecodeErrorZ_free @@ -8799,6 +9783,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdat JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UnsignedChannelUpdateDecodeErrorZ_clone @@ -8823,6 +9815,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeE JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelUpdateDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelUpdateDecodeErrorZ_free @@ -8831,6 +9831,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeE JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelUpdateDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelUpdateDecodeErrorZ_clone @@ -8855,6 +9863,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeEr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ErrorMessageDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ErrorMessageDecodeErrorZ_free @@ -8863,6 +9879,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeEr JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ErrorMessageDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ErrorMessageDecodeErrorZ_clone @@ -8887,6 +9911,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnounce JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UnsignedNodeAnnouncementDecodeErrorZ_free @@ -8895,6 +9927,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnounce JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone @@ -8919,6 +9959,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDeco JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeAnnouncementDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeAnnouncementDecodeErrorZ_free @@ -8927,6 +9975,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDeco JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeAnnouncementDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeAnnouncementDecodeErrorZ_clone @@ -8951,6 +10007,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIds JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryShortChannelIdsDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_QueryShortChannelIdsDecodeErrorZ_free @@ -8959,6 +10023,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIds JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_QueryShortChannelIdsDecodeErrorZ_clone @@ -8983,6 +10055,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIds JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ReplyShortChannelIdsEndDecodeErrorZ_free @@ -8991,6 +10071,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIds JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone @@ -9015,6 +10103,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryChannelRangeDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_QueryChannelRangeDecodeErrorZ_free @@ -9023,6 +10119,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDec JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_QueryChannelRangeDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_QueryChannelRangeDecodeErrorZ_clone @@ -9047,6 +10151,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyChannelRangeDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ReplyChannelRangeDecodeErrorZ_free @@ -9055,6 +10167,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDec JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ReplyChannelRangeDecodeErrorZ_clone @@ -9079,6 +10199,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilte JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_GossipTimestampFilterDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_GossipTimestampFilterDecodeErrorZ_free @@ -9087,6 +10215,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilte JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_GossipTimestampFilterDecodeErrorZ_clone @@ -9111,6 +10247,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreatio JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceSignOrCreationErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceSignOrCreationErrorZ_free @@ -9119,6 +10263,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreatio JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceSignOrCreationErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_InvoiceSignOrCreationErrorZ_clone @@ -9167,6 +10319,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitor JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1err (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_LockedChannelMonitorNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_LockedChannelMonitorNoneZ_free @@ -9191,6 +10351,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: PaymentPurpose_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PaymentPurpose_clone @@ -9223,6 +10391,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ClosureReason_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ClosureReason_clone @@ -9295,6 +10471,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1chan JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ClosureReason_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: Event_free @@ -9303,6 +10487,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Event_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Event_clone @@ -9393,10 +10585,26 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Event_1write /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_free - * Signature: (J)V + * Method: Event_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: MessageSendEvent_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: MessageSendEvent_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr (JNIEnv *, jclass, jlong); /* @@ -9591,6 +10799,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: APIError_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: APIError_clone @@ -9743,6 +10959,110 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Level_1hash JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1max (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: Record_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_get_level + * Signature: (J)Lorg/ldk/enums/Level; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Record_1get_1level + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_set_level + * Signature: (JLorg/ldk/enums/Level;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level + (JNIEnv *, jclass, jlong, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_get_args + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_set_args + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args + (JNIEnv *, jclass, jlong, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_get_module_path + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_set_module_path + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path + (JNIEnv *, jclass, jlong, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_get_file + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_set_file + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file + (JNIEnv *, jclass, jlong, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_get_line + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_Record_1get_1line + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_set_line + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line + (JNIEnv *, jclass, jlong, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Record_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Record_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Logger_free @@ -9815,6 +11135,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new (JNIEnv *, jclass, jint, jshort, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelHandshakeConfig_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelHandshakeConfig_clone @@ -9975,6 +11303,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1t JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jshort, jint, jboolean, jshort); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelHandshakeLimits_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelHandshakeLimits_clone @@ -10119,6 +11455,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1clo JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new (JNIEnv *, jclass, jint, jint, jshort, jboolean, jboolean, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelConfig_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelConfig_clone @@ -10231,6 +11575,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwa JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1new (JNIEnv *, jclass, jlong, jlong, jlong, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: UserConfig_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UserConfig_clone @@ -10255,6 +11607,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: BestBlock_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: BestBlock_clone @@ -10447,6 +11807,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pu JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: WatchedOutput_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: WatchedOutput_clone @@ -10527,6 +11895,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: MonitorUpdateId_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: MonitorUpdateId_clone @@ -10671,6 +12047,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1up JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMonitorUpdate_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelMonitorUpdate_clone @@ -10727,6 +12111,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1set_1a JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new (JNIEnv *, jclass, jstring); +/* + * Class: org_ldk_impl_bindings + * Method: MonitorUpdateError_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: MonitorUpdateError_clone @@ -10743,6 +12135,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: MonitorEvent_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: MonitorEvent_clone @@ -10791,6 +12191,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: MonitorEvent_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: HTLCUpdate_free @@ -10799,6 +12207,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: HTLCUpdate_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: HTLCUpdate_clone @@ -10831,6 +12247,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Balance_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Balance_clone @@ -10887,6 +12311,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelMonitor_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelMonitor_clone @@ -11087,6 +12519,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new (JNIEnv *, jclass, jbyteArray, jshort); +/* + * Class: org_ldk_impl_bindings + * Method: OutPoint_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: OutPoint_clone @@ -11255,6 +12695,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new (JNIEnv *, jclass, jlong, jbyteArray, jshort, jlong, jbyteArray, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: DelayedPaymentOutputDescriptor_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: DelayedPaymentOutputDescriptor_clone @@ -11351,6 +12799,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new (JNIEnv *, jclass, jlong, jlong, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: StaticPaymentOutputDescriptor_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: StaticPaymentOutputDescriptor_clone @@ -11383,6 +12839,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: SpendableOutputDescriptor_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: SpendableOutputDescriptor_clone @@ -11439,6 +12903,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1re JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Sign_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Sign_clone @@ -11567,6 +13039,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1com JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed (JNIEnv *, jclass, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: InMemorySigner_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InMemorySigner_clone @@ -11775,6 +13255,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1bl JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new (JNIEnv *, jclass, jobject, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChainParameters_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChainParameters_clone @@ -11847,6 +13335,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1new (JNIEnv *, jclass, jint, jint, jshort); +/* + * Class: org_ldk_impl_bindings + * Method: CounterpartyForwardingInfo_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CounterpartyForwardingInfo_clone @@ -11935,6 +13431,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forw JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelCounterparty_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelCounterparty_clone @@ -12199,6 +13703,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1publi JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_clone @@ -12215,6 +13727,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: PaymentSendFailure_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PaymentSendFailure_clone @@ -12623,6 +14143,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMana JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: DecodeError_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: DecodeError_clone @@ -12663,6 +14191,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1new (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Init_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Init_clone @@ -12716,8 +14252,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data * Method: ErrorMessage_new * Signature: ([BLjava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new - (JNIEnv *, jclass, jbyteArray, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new + (JNIEnv *, jclass, jbyteArray, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: ErrorMessage_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -12775,6 +14319,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new (JNIEnv *, jclass, jshort, jshort); +/* + * Class: org_ldk_impl_bindings + * Method: Ping_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Ping_clone @@ -12815,6 +14367,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new (JNIEnv *, jclass, jshort); +/* + * Class: org_ldk_impl_bindings + * Method: Pong_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Pong_clone @@ -13119,6 +14679,14 @@ JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1fl JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags (JNIEnv *, jclass, jlong, jbyte); +/* + * Class: org_ldk_impl_bindings + * Method: OpenChannel_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: OpenChannel_clone @@ -13359,6 +14927,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1firs JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point (JNIEnv *, jclass, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: AcceptChannel_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: AcceptChannel_clone @@ -13447,6 +15023,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new (JNIEnv *, jclass, jbyteArray, jbyteArray, jshort, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: FundingCreated_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: FundingCreated_clone @@ -13503,6 +15087,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new (JNIEnv *, jclass, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: FundingSigned_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: FundingSigned_clone @@ -13559,6 +15151,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new (JNIEnv *, jclass, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: FundingLocked_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: FundingLocked_clone @@ -13615,6 +15215,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new (JNIEnv *, jclass, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: Shutdown_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Shutdown_clone @@ -13671,6 +15279,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1ma JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ClosingSignedFeeRange_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ClosingSignedFeeRange_clone @@ -13759,6 +15375,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ClosingSigned_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ClosingSigned_clone @@ -13855,6 +15479,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expi JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry (JNIEnv *, jclass, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: UpdateAddHTLC_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UpdateAddHTLC_clone @@ -13927,6 +15559,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1paymen JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: UpdateFulfillHTLC_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UpdateFulfillHTLC_clone @@ -13975,6 +15615,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: UpdateFailHTLC_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UpdateFailHTLC_clone @@ -14039,6 +15687,14 @@ JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code (JNIEnv *, jclass, jlong, jshort); +/* + * Class: org_ldk_impl_bindings + * Method: UpdateFailMalformedHTLC_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UpdateFailMalformedHTLC_clone @@ -14103,6 +15759,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1s JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new (JNIEnv *, jclass, jbyteArray, jbyteArray, jobjectArray); +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentSigned_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CommitmentSigned_clone @@ -14175,6 +15839,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: RevokeAndACK_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RevokeAndACK_clone @@ -14231,6 +15903,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new (JNIEnv *, jclass, jbyteArray, jint); +/* + * Class: org_ldk_impl_bindings + * Method: UpdateFee_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UpdateFee_clone @@ -14287,6 +15967,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1curr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new (JNIEnv *, jclass, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: DataLossProtect_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: DataLossProtect_clone @@ -14351,6 +16039,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelReestablish_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelReestablish_clone @@ -14439,6 +16135,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1b JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: AnnouncementSignatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: AnnouncementSignatures_clone @@ -14455,6 +16159,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NetAddress_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: NetAddress_clone @@ -14607,6 +16319,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses (JNIEnv *, jclass, jlong, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedNodeAnnouncement_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UnsignedNodeAnnouncement_clone @@ -14663,6 +16383,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1content JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new (JNIEnv *, jclass, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NodeAnnouncement_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: NodeAnnouncement_clone @@ -14791,6 +16519,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncem JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12 (JNIEnv *, jclass, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelAnnouncement_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UnsignedChannelAnnouncement_clone @@ -14895,6 +16631,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1cont JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelAnnouncement_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelAnnouncement_clone @@ -15039,6 +16783,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fe JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths (JNIEnv *, jclass, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelUpdate_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: UnsignedChannelUpdate_clone @@ -15095,6 +16847,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new (JNIEnv *, jclass, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelUpdate_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelUpdate_clone @@ -15167,6 +16927,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new (JNIEnv *, jclass, jbyteArray, jint, jint); +/* + * Class: org_ldk_impl_bindings + * Method: QueryChannelRange_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: QueryChannelRange_clone @@ -15263,6 +17031,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new (JNIEnv *, jclass, jbyteArray, jint, jint, jboolean, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: ReplyChannelRange_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ReplyChannelRange_clone @@ -15311,6 +17087,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1sho JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new (JNIEnv *, jclass, jbyteArray, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: QueryShortChannelIds_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: QueryShortChannelIds_clone @@ -15367,6 +17151,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new (JNIEnv *, jclass, jbyteArray, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: ReplyShortChannelIdsEnd_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ReplyShortChannelIdsEnd_clone @@ -15439,6 +17231,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ti JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new (JNIEnv *, jclass, jbyteArray, jint, jint); +/* + * Class: org_ldk_impl_bindings + * Method: GossipTimestampFilter_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: GossipTimestampFilter_clone @@ -15455,6 +17255,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ErrorAction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ErrorAction_clone @@ -15543,6 +17351,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new (JNIEnv *, jclass, jstring, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LightningError_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LightningError_clone @@ -15663,6 +17479,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitm JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new (JNIEnv *, jclass, jlongArray, jlongArray, jlongArray, jlongArray, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentUpdate_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CommitmentUpdate_clone @@ -16343,6 +18167,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1ha JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: SocketDescriptor_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: SocketDescriptor_clone @@ -16391,6 +18223,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1conn JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new (JNIEnv *, jclass, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: PeerHandleError_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PeerHandleError_clone @@ -16639,6 +18479,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: TxCreationKeys_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: TxCreationKeys_clone @@ -16759,6 +18607,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelPublicKeys_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelPublicKeys_clone @@ -16903,6 +18759,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1t JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new (JNIEnv *, jclass, jboolean, jlong, jint, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: HTLCOutputInCommitment_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: HTLCOutputInCommitment_clone @@ -17047,6 +18911,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new (JNIEnv *, jclass, jlong, jshort, jboolean, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTransactionParameters_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelTransactionParameters_clone @@ -17100,8 +18972,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction * Method: CounterpartyChannelTransactionParameters_new * Signature: (JS)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new - (JNIEnv *, jclass, jlong, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new + (JNIEnv *, jclass, jlong, jshort); + +/* + * Class: org_ldk_impl_bindings + * Method: CounterpartyChannelTransactionParameters_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -17247,6 +19127,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs (JNIEnv *, jclass, jlong, jobjectArray); +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: HolderCommitmentTransaction_clone @@ -17327,6 +19215,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new (JNIEnv *, jclass, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: BuiltCommitmentTransaction_clone @@ -17375,6 +19271,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransacti JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ClosingTransaction_clone @@ -17487,6 +19391,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransactio JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CommitmentTransaction_clone @@ -17639,6 +19551,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InitFeatures_clone @@ -17647,6 +19567,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: NodeFeatures_clone @@ -17655,6 +19583,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelFeatures_clone @@ -17663,6 +19599,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InvoiceFeatures_clone @@ -17895,6 +19839,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ShutdownScript_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ShutdownScript_clone @@ -17935,6 +19887,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1sc JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: InvalidShutdownScript_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InvalidShutdownScript_clone @@ -18015,6 +19975,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compat JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Type_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Type_clone @@ -18071,6 +20039,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LockableScore_1write JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NodeId_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: NodeId_clone @@ -18127,6 +20103,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1read JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: NetworkGraph_clone @@ -18151,6 +20135,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NetworkUpdate_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: NetworkUpdate_clone @@ -18191,6 +20183,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NetworkUpdate_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: NetGraphMsgHandler_as_EventHandler @@ -18367,6 +20367,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new (JNIEnv *, jclass, jint, jboolean, jshort, jlong, jlong, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: DirectionalChannelInfo_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: DirectionalChannelInfo_clone @@ -18519,6 +20527,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelInfo_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelInfo_clone @@ -18599,6 +20615,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: RoutingFees_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RoutingFees_clone @@ -18735,6 +20759,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ann JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new (JNIEnv *, jclass, jlong, jint, jbyteArray, jbyteArray, jlongArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NodeAnnouncementInfo_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: NodeAnnouncementInfo_clone @@ -18815,6 +20847,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1i JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new (JNIEnv *, jclass, jlongArray, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NodeInfo_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: NodeInfo_clone @@ -19055,6 +21095,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1d JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1new (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: RouteHop_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RouteHop_clone @@ -19143,6 +21191,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payee JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new (JNIEnv *, jclass, jobjectArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Route_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Route_clone @@ -19263,6 +21319,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1c JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new (JNIEnv *, jclass, jlong, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: RouteParameters_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RouteParameters_clone @@ -19367,6 +21431,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1expiry_1time JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1new (JNIEnv *, jclass, jbyteArray, jlong, jlongArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Payee_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Payee_clone @@ -19455,6 +21527,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1new (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: RouteHint_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RouteHint_clone @@ -19607,6 +21687,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maxim JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new (JNIEnv *, jclass, jbyteArray, jlong, jlong, jshort, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: RouteHintHop_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RouteHintHop_clone @@ -19903,6 +21991,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Invoice_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Invoice_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Invoice_clone @@ -19927,6 +22023,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: SignedRawInvoice_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: SignedRawInvoice_clone @@ -19967,6 +22071,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: RawInvoice_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RawInvoice_clone @@ -20007,6 +22119,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: RawDataPart_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RawDataPart_clone @@ -20031,6 +22151,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: PositiveTimestamp_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PositiveTimestamp_clone @@ -20167,6 +22295,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Currency_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Sha256_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sha256_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Sha256_clone @@ -20199,6 +22335,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Description_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Description_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Description_clone @@ -20255,6 +22399,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: PayeePubKey_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PayeePubKey_clone @@ -20287,6 +22439,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ExpiryTime_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ExpiryTime_clone @@ -20343,6 +22503,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: MinFinalCltvExpiry_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: MinFinalCltvExpiry_clone @@ -20375,6 +22543,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Fallback_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Fallback_clone @@ -20431,6 +22607,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Fallback_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceSignature_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: InvoiceSignature_clone @@ -20455,6 +22639,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: PrivateRoute_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PrivateRoute_clone @@ -21015,6 +23207,14 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SemanticError_1to_1str JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: SignOrCreationError_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: SignOrCreationError_clone @@ -21111,6 +23311,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: RetryAttempts_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: RetryAttempts_clone @@ -21143,6 +23351,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: PaymentError_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PaymentError_clone diff --git a/ts/bindings.c b/ts/bindings.c index e738038d..a86ed720 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -22,6 +22,7 @@ void free(void *ptr); #define DO_ASSERT(a) (void)(a) #define CHECK(a) #define CHECK_ACCESS(p) +#define CHECK_INNER_FIELD_ACCESS_OR_NULL(v) // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed) _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec and [u8] need to have been mapped identically"); @@ -312,20 +313,6 @@ static inline int32_t LDKSiPrefix_to_js(LDKSiPrefix val) { default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_u8Z_new(int8_tArray elems) { - LDKCVec_u8Z *ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVec_u8Z Data"); - int8_t *java_elems = (int8_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - } - return (uint64_t)ret; -} static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen); @@ -346,9 +333,6 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}int64_t return ret_val; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_get_ok(uint32_t arg) { LDKCResult_SecretKeyErrorZ *val = (LDKCResult_SecretKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -362,9 +346,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_g uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PublicKeyErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PublicKeyErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PublicKeyErrorZ_get_ok(uint32_t arg) { LDKCResult_PublicKeyErrorZ *val = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -378,9 +359,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PublicKeyErrorZ_g uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_TxCreationKeysDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -388,6 +366,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -398,12 +377,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelPublicKeysDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -411,6 +388,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeys uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -421,12 +399,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeys uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_TxCreationKeysErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErrorZ_get_ok(uint32_t arg) { LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -434,6 +410,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -455,9 +432,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u32Z_ref_from_ptr( default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -465,6 +439,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommi uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -475,12 +450,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommi uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -488,6 +461,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChann uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -498,12 +472,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChann uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -511,6 +483,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactio uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -521,12 +494,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactio uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -534,6 +505,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentT uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -544,12 +516,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentT uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -557,6 +527,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -567,12 +538,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransactionNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_TrustedClosingTransactionNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransactionNoneZ_get_ok(uint32_t arg) { LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -580,6 +549,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTra uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -588,9 +558,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransac CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -598,6 +565,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransac uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -608,12 +576,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransac uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_TrustedCommitmentTransactionNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(uint32_t arg) { LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -621,6 +587,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitment uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -629,9 +596,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTran CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok; -} ptrArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_get_ok(uint32_t arg) { LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -652,9 +616,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_ CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ShutdownScriptDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -662,6 +623,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -672,12 +634,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(uint32_t arg) { - return ((LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint32_t arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); CHECK(val->result_ok); @@ -685,6 +645,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInv uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -695,12 +656,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInv uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneErrorZ *val = (LDKCResult_NoneErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -712,9 +671,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_get_er uint32_t err_conv = LDKIOError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteHopDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -722,6 +678,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -732,28 +689,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHopZ_new(uint32_tArray elems) { - LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVec_RouteHopZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKRouteHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -768,9 +707,6 @@ static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_C } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -778,6 +714,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -788,12 +725,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -801,6 +736,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -811,28 +747,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintZ_new(uint32_tArray elems) { - LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKRouteHint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -852,9 +770,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u64Z_ref_from_ptr( default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -862,6 +777,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -872,28 +788,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintHopZ_new(uint32_tArray elems) { - LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKRouteHintHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHintHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -901,9 +799,6 @@ static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_Route } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -911,6 +806,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeEr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -921,12 +817,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -934,6 +828,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -944,28 +839,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelDetailsZ_new(uint32_tArray elems) { - LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKChannelDetails arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelDetails_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -973,9 +850,6 @@ static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_C } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -983,6 +857,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -993,12 +868,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxOutAccessErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxOutAccessErrorZ_get_ok(uint32_t arg) { LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1032,25 +905,6 @@ int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ return ret_arr; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_usizeTransactionZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_usizeTransactionZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "LDKCVec_C2Tuple_usizeTransactionZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * ret->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1065,9 +919,6 @@ static inline LDKCVec_TxidZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_TxidZ *orig } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(uint32_t arg) { LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); CHECK(val->result_ok); @@ -1087,6 +938,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr( uint64_t htlc_event_ref = 0; CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1; return 0 /* LDKMonitorEvent - HTLCEvent */; (void) htlc_event_ref; } @@ -1095,6 +947,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr( uint64_t commitment_tx_confirmed_ref = 0; CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1; return 0 /* LDKMonitorEvent - CommitmentTxConfirmed */; (void) commitment_tx_confirmed_ref; } @@ -1103,6 +956,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr( uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1; return 0 /* LDKMonitorEvent - UpdateCompleted */; (void) funding_txo_ref; (void) obj->update_completed.monitor_update_id; } @@ -1111,31 +965,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr( uint64_t update_failed_ref = 0; CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); update_failed_ref = (uint64_t)update_failed_var.inner & ~1; return 0 /* LDKMonitorEvent - UpdateFailed */; (void) update_failed_ref; } default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_MonitorEventZ_new(uint32_tArray elems) { - LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVec_MonitorEventZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr); - arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1158,6 +994,67 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_C2Tuple_usizeTrans default: abort(); } } +uint32_t __attribute__((visibility("default"))) TS_LDKClosureReason_ref_from_ptr(uint32_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); + switch(obj->tag) { + case LDKClosureReason_CounterpartyForceClosed: { + LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; + jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len); + return 0 /* LDKClosureReason - CounterpartyForceClosed */; (void) peer_msg_conv; + } + case LDKClosureReason_HolderForceClosed: { + return 0 /* LDKClosureReason - HolderForceClosed */; + } + case LDKClosureReason_CooperativeClosure: { + return 0 /* LDKClosureReason - CooperativeClosure */; + } + case LDKClosureReason_CommitmentTxConfirmed: { + return 0 /* LDKClosureReason - CommitmentTxConfirmed */; + } + case LDKClosureReason_ProcessingError: { + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len); + return 0 /* LDKClosureReason - ProcessingError */; (void) err_conv; + } + case LDKClosureReason_DisconnectedPeer: { + return 0 /* LDKClosureReason - DisconnectedPeer */; + } + case LDKClosureReason_OutdatedChannelManager: { + return 0 /* LDKClosureReason - OutdatedChannelManager */; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_ClosureReasonZ_ref_from_ptr(uint32_t ptr) { + LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_ClosureReasonZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return 0 /* LDKCOption_ClosureReasonZ - Some */; (void) some_ref; + } + case LDKCOption_ClosureReasonZ_None: { + return 0 /* LDKCOption_ClosureReasonZ - None */; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_ok(uint32_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint32_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} uint32_t __attribute__((visibility("default"))) TS_LDKNetworkUpdate_ref_from_ptr(uint32_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)(ptr & ~1); switch(obj->tag) { @@ -1166,6 +1063,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKNetworkUpdate_ref_from_ptr uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKNetworkUpdate - ChannelUpdateMessage */; (void) msg_ref; } @@ -1201,6 +1099,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ uint64_t outpoint_ref = 0; CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); outpoint_ref = (uint64_t)outpoint_var.inner & ~1; uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1; return 0 /* LDKSpendableOutputDescriptor - StaticOutput */; (void) outpoint_ref; (void) (uint64_t)output_ref; @@ -1210,6 +1109,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ uint64_t delayed_payment_output_ref = 0; CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var); delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1; return 0 /* LDKSpendableOutputDescriptor - DelayedPaymentOutput */; (void) delayed_payment_output_ref; } @@ -1218,31 +1118,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ uint64_t static_payment_output_ref = 0; CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var); static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1; return 0 /* LDKSpendableOutputDescriptor - StaticPaymentOutput */; (void) static_payment_output_ref; } default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_SpendableOutputDescriptorZ_new(uint32_tArray elems) { - LDKCVec_SpendableOutputDescriptorZ *ret = MALLOC(sizeof(LDKCVec_SpendableOutputDescriptorZ), "LDKCVec_SpendableOutputDescriptorZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVec_SpendableOutputDescriptorZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr); - arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) { LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1250,6 +1132,148 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } return ret; } +uint32_t __attribute__((visibility("default"))) TS_LDKPaymentPurpose_ref_from_ptr(uint32_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); + switch(obj->tag) { + case LDKPaymentPurpose_InvoicePayment: { + int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_preimage_arr + 4), obj->invoice_payment.payment_preimage.data, 32); + int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_secret_arr + 4), obj->invoice_payment.payment_secret.data, 32); + return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr; (void) obj->invoice_payment.user_payment_id; + } + case LDKPaymentPurpose_SpontaneousPayment: { + int8_tArray spontaneous_payment_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(spontaneous_payment_arr + 4), obj->spontaneous_payment.data, 32); + return 0 /* LDKPaymentPurpose - SpontaneousPayment */; (void) spontaneous_payment_arr; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKEvent_ref_from_ptr(uint32_t ptr) { + LDKEvent *obj = (LDKEvent*)(ptr & ~1); + switch(obj->tag) { + case LDKEvent_FundingGenerationReady: { + int8_tArray temporary_channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(temporary_channel_id_arr + 4), obj->funding_generation_ready.temporary_channel_id.data, 32); + LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; + int8_tArray output_script_arr = init_arr(output_script_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(output_script_arr + 4), output_script_var.data, output_script_var.datalen); + return 0 /* LDKEvent - FundingGenerationReady */; (void) temporary_channel_id_arr; (void) obj->funding_generation_ready.channel_value_satoshis; (void) output_script_arr; (void) obj->funding_generation_ready.user_channel_id; + } + case LDKEvent_PaymentReceived: { + int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_received.payment_hash.data, 32); + uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; + return 0 /* LDKEvent - PaymentReceived */; (void) payment_hash_arr; (void) obj->payment_received.amt; (void) purpose_ref; + } + case LDKEvent_PaymentSent: { + int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_sent.payment_id.data, 32); + int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_preimage_arr + 4), obj->payment_sent.payment_preimage.data, 32); + int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_sent.payment_hash.data, 32); + uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; + return 0 /* LDKEvent - PaymentSent */; (void) payment_id_arr; (void) payment_preimage_arr; (void) payment_hash_arr; (void) fee_paid_msat_ref; + } + case LDKEvent_PaymentPathFailed: { + int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_path_failed.payment_id.data, 32); + int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_path_failed.payment_hash.data, 32); + uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; + LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; + uint32_tArray path_arr = NULL; + path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *path_arr_ptr = (uint32_t*)(path_arr + 4); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + uint64_t path_conv_10_ref = 0; + CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_arr_ptr[k] = path_conv_10_ref; + } + + uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; + LDKRouteParameters retry_var = obj->payment_path_failed.retry; + uint64_t retry_ref = 0; + if ((uint64_t)retry_var.inner > 4096) { + CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var); + retry_ref = (uint64_t)retry_var.inner & ~1; + } + return 0 /* LDKEvent - PaymentPathFailed */; (void) payment_id_arr; (void) payment_hash_arr; (void) obj->payment_path_failed.rejected_by_dest; (void) network_update_ref; (void) obj->payment_path_failed.all_paths_failed; (void) path_arr; (void) short_channel_id_ref; (void) retry_ref; + } + case LDKEvent_PendingHTLCsForwardable: { + return 0 /* LDKEvent - PendingHTLCsForwardable */; (void) obj->pending_htl_cs_forwardable.time_forwardable; + } + case LDKEvent_SpendableOutputs: { + LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; + uint32_tArray outputs_arr = NULL; + outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *outputs_arr_ptr = (uint32_t*)(outputs_arr + 4); + for (size_t b = 0; b < outputs_var.datalen; b++) { + uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; + outputs_arr_ptr[b] = outputs_conv_27_ref; + } + + return 0 /* LDKEvent - SpendableOutputs */; (void) outputs_arr; + } + case LDKEvent_PaymentForwarded: { + uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; + return 0 /* LDKEvent - PaymentForwarded */; (void) fee_earned_msat_ref; (void) obj->payment_forwarded.claim_from_onchain_tx; + } + case LDKEvent_ChannelClosed: { + int8_tArray channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(channel_id_arr + 4), obj->channel_closed.channel_id.data, 32); + uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; + return 0 /* LDKEvent - ChannelClosed */; (void) channel_id_arr; (void) obj->channel_closed.user_channel_id; (void) reason_ref; + } + case LDKEvent_DiscardFunding: { + int8_tArray channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(channel_id_arr + 4), obj->discard_funding.channel_id.data, 32); + LDKTransaction transaction_var = obj->discard_funding.transaction; + int8_tArray transaction_arr = init_arr(transaction_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(transaction_arr + 4), transaction_var.data, transaction_var.datalen); + return 0 /* LDKEvent - DiscardFunding */; (void) channel_id_arr; (void) transaction_arr; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_EventZ_ref_from_ptr(uint32_t ptr) { + LDKCOption_EventZ *obj = (LDKCOption_EventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_EventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return 0 /* LDKCOption_EventZ - Some */; (void) some_ref; + } + case LDKCOption_EventZ_None: { + return 0 /* LDKCOption_EventZ - None */; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_EventZDecodeErrorZ_get_ok(uint32_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_EventZDecodeErrorZ_get_err(uint32_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(uint32_t ptr) { LDKErrorAction *obj = (LDKErrorAction*)(ptr & ~1); switch(obj->tag) { @@ -1259,6 +1283,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(u if ((uint64_t)msg_var.inner > 4096) { CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; } return 0 /* LDKErrorAction - DisconnectPeer */; (void) msg_ref; @@ -1275,6 +1300,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(u uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKErrorAction - SendErrorMessage */; (void) msg_ref; } @@ -1291,6 +1317,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendAcceptChannel */; (void) node_id_arr; (void) msg_ref; } @@ -1301,6 +1328,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendOpenChannel */; (void) node_id_arr; (void) msg_ref; } @@ -1311,6 +1339,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendFundingCreated */; (void) node_id_arr; (void) msg_ref; } @@ -1321,6 +1350,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendFundingSigned */; (void) node_id_arr; (void) msg_ref; } @@ -1331,6 +1361,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendFundingLocked */; (void) node_id_arr; (void) msg_ref; } @@ -1341,6 +1372,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendAnnouncementSignatures */; (void) node_id_arr; (void) msg_ref; } @@ -1351,6 +1383,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t updates_ref = 0; CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var); updates_ref = (uint64_t)updates_var.inner & ~1; return 0 /* LDKMessageSendEvent - UpdateHTLCs */; (void) node_id_arr; (void) updates_ref; } @@ -1361,6 +1394,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendRevokeAndACK */; (void) node_id_arr; (void) msg_ref; } @@ -1371,6 +1405,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendClosingSigned */; (void) node_id_arr; (void) msg_ref; } @@ -1381,6 +1416,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendShutdown */; (void) node_id_arr; (void) msg_ref; } @@ -1391,6 +1427,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendChannelReestablish */; (void) node_id_arr; (void) msg_ref; } @@ -1399,11 +1436,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; uint64_t update_msg_ref = 0; CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var); update_msg_ref = (uint64_t)update_msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - BroadcastChannelAnnouncement */; (void) msg_ref; (void) update_msg_ref; } @@ -1412,6 +1451,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - BroadcastNodeAnnouncement */; (void) msg_ref; } @@ -1420,6 +1460,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - BroadcastChannelUpdate */; (void) msg_ref; } @@ -1430,6 +1471,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendChannelUpdate */; (void) node_id_arr; (void) msg_ref; } @@ -1446,6 +1488,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendChannelRangeQuery */; (void) node_id_arr; (void) msg_ref; } @@ -1456,6 +1499,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendShortIdsQuery */; (void) node_id_arr; (void) msg_ref; } @@ -1466,31 +1510,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendReplyChannelRange */; (void) node_id_arr; (void) msg_ref; } default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_MessageSendEventZ_new(uint32_tArray elems) { - LDKCVec_MessageSendEventZ *ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVec_MessageSendEventZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr); - arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) { LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1498,9 +1524,6 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InitFeaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1508,6 +1531,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1518,12 +1542,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeFeaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1531,6 +1553,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1541,12 +1564,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelFeaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1554,6 +1575,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1564,12 +1586,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1577,6 +1597,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1587,12 +1608,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1600,6 +1619,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParameters uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1610,12 +1630,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParameters uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1623,6 +1641,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1633,12 +1652,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1646,6 +1663,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOut uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1656,12 +1674,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOut uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1669,6 +1685,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1679,12 +1696,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutp uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1698,12 +1713,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SpendableOutputDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneNoneZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneNoneZ_get_ok(uint32_t arg) { LDKCResult_NoneNoneZ *val = (LDKCResult_NoneNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1743,9 +1756,6 @@ ptrArray __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_Signat return ret_arr; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(uint32_t arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1759,9 +1769,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_SignatureCVec CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SignatureNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_SignatureNoneZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_SignatureNoneZ_get_ok(uint32_t arg) { LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1832,6 +1839,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th holder_tx_var = HolderCommitmentTransaction_clone(holder_tx); CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); holder_tx_ref = (uint64_t)holder_tx_var.inner; if (holder_tx_var.is_owned) { holder_tx_ref |= 1; @@ -1840,7 +1848,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { @@ -1858,6 +1866,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L commitment_tx_var = CommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -1866,7 +1875,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); - ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) { @@ -1877,7 +1886,7 @@ LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const vo void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) { @@ -1887,6 +1896,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -1895,7 +1905,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); - ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32]) { @@ -1910,7 +1920,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) { @@ -1926,6 +1936,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -1934,7 +1945,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) { @@ -1950,6 +1961,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -1958,7 +1970,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) { @@ -1968,6 +1980,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* closing_tx_var = ClosingTransaction_clone(closing_tx); CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var); closing_tx_ref = (uint64_t)closing_tx_var.inner; if (closing_tx_var.is_owned) { closing_tx_ref |= 1; @@ -1976,7 +1989,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) { @@ -1986,6 +1999,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void msg_var = UnsignedChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -1994,7 +2008,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { @@ -2004,6 +2018,7 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); channel_parameters_ref = (uint64_t)channel_parameters_var.inner; if (channel_parameters_var.is_owned) { channel_parameters_ref |= 1; @@ -2022,7 +2037,7 @@ static inline LDKBaseSign LDKBaseSign_init (/*TODO: JS Object Reference */void* LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKBaseSign ret = { .this_arg = (void*) calls, @@ -2075,6 +2090,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_validate_holder_com LDKHolderCommitmentTransaction holder_tx_conv; holder_tx_conv.inner = (void*)(holder_tx & (~1)); holder_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv); return (uint64_t)ret_conv; @@ -2096,6 +2112,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_counterparty_c LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -2121,6 +2138,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_holder_commitm LDKHolderCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -2160,6 +2178,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_justice_revoke LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_justice_revoked_htlc)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -2180,6 +2199,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_counterparty_h LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -2192,6 +2212,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_closing_transa LDKClosingTransaction closing_tx_conv; closing_tx_conv.inner = (void*)(closing_tx & (~1)); closing_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv); return (uint64_t)ret_conv; @@ -2204,6 +2225,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_channel_announ LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -2216,6 +2238,7 @@ void __attribute__((visibility("default"))) TS_BaseSign_ready_channel(uint32_t LDKChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv); } @@ -2232,6 +2255,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_get_pubkeys(uint32_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -2273,7 +2297,7 @@ static inline LDKSign LDKSign_init (/*TODO: JS Object Reference */void* o, /*TOD LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKSign ret = { .this_arg = (void*) calls, @@ -2301,9 +2325,6 @@ int8_tArray __attribute__((visibility("default"))) TS_Sign_write(uint32_t this_ return ret_arr; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_SignDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2318,12 +2339,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RecoverableSignatureNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_RecoverableSignatureNoneZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_RecoverableSignatureNoneZ_get_ok(uint32_t arg) { LDKCResult_RecoverableSignatureNoneZ *val = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2343,9 +2362,6 @@ static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *or } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_CVec_CVec_u8ZZNoneZ*)arg)->result_ok; -} ptrArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(uint32_t arg) { LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2367,9 +2383,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_g CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InMemorySignerDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2377,6 +2390,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2387,28 +2401,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_TxOutZ_new(uint32_tArray elems) { - LDKCVec_TxOutZ *ret = MALLOC(sizeof(LDKCVec_TxOutZ), "LDKCVec_TxOutZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVec_TxOutZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr); - arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2416,9 +2412,6 @@ static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TransactionNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_TransactionNoneZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_TransactionNoneZ_get_ok(uint32_t arg) { LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2451,6 +2444,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMoni uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -2458,25 +2452,6 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMoni return ret_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_BlockHashChannelMonitorZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_BlockHashChannelMonitorZZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * ret->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) { LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2484,9 +2459,6 @@ static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashCh } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)arg)->result_ok; -} uint32_tArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(uint32_t arg) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2552,15 +2524,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKAPIError_ref_from_ptr(uint uint64_t script_ref = 0; CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); script_ref = (uint64_t)script_var.inner & ~1; return 0 /* LDKAPIError - IncompatibleShutdownScript */; (void) script_ref; } default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneAPIErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneAPIErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2572,25 +2542,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneAPIErrorZ_get uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_CResult_NoneAPIErrorZZ_new(uint32_tArray elems) { - LDKCVec_CResult_NoneAPIErrorZZ *ret = MALLOC(sizeof(LDKCVec_CResult_NoneAPIErrorZZ), "LDKCVec_CResult_NoneAPIErrorZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * ret->datalen, "LDKCVec_CResult_NoneAPIErrorZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr); - arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) { LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2598,25 +2549,6 @@ static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(c } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_APIErrorZ_new(uint32_tArray elems) { - LDKCVec_APIErrorZ *ret = MALLOC(sizeof(LDKCVec_APIErrorZ), "LDKCVec_APIErrorZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKAPIError) * ret->datalen, "LDKCVec_APIErrorZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr); - arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) { LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2624,9 +2556,6 @@ static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *or } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult__u832APIErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult__u832APIErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult__u832APIErrorZ_get_ok(uint32_t arg) { LDKCResult__u832APIErrorZ *val = (LDKCResult__u832APIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2690,6 +2619,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKPaymentSendFailure_ref_fro if ((uint64_t)failed_paths_retry_var.inner > 4096) { CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1; } int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -2699,9 +2629,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKPaymentSendFailure_ref_fro default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(uint32_t arg) { - return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(uint32_t arg) { LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -2715,9 +2642,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentS uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NonePaymentSendFailureZ_result_ok(uint32_t arg) { - return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NonePaymentSendFailureZ_get_ok(uint32_t arg) { LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -2749,9 +2673,6 @@ int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymen return ret_arr; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(uint32_t arg) { - return ((LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(uint32_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -2792,25 +2713,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKNetAddress_ref_from_ptr(ui default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_NetAddressZ_new(uint32_tArray elems) { - LDKCVec_NetAddressZ *ret = MALLOC(sizeof(LDKCVec_NetAddressZ), "LDKCVec_NetAddressZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVec_NetAddressZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr); - arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2838,9 +2740,6 @@ int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymen return ret_arr; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretAPIErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PaymentSecretAPIErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretAPIErrorZ_get_ok(uint32_t arg) { LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2854,25 +2753,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretAPIE uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelMonitorZ_new(uint32_tArray elems) { - LDKCVec_ChannelMonitorZ *ret = MALLOC(sizeof(LDKCVec_ChannelMonitorZ), "LDKCVec_ChannelMonitorZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVec_ChannelMonitorZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKChannelMonitor arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelMonitor_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) { LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2901,6 +2781,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -2909,6 +2790,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t monitor_ref = 0; CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = (uint64_t)monitor_var.inner; if (monitor_var.is_owned) { monitor_ref |= 1; @@ -2917,7 +2799,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) { @@ -2926,6 +2808,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -2934,6 +2817,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t update_ref = 0; CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -2942,7 +2826,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { @@ -2960,7 +2844,7 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1); CHECK_ACCESS(ret_conv_14_ptr); LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr); - ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1)); + FREE((void*)ret_conv_14); ret_constr.data[o] = ret_conv_14_conv; } return ret_constr; @@ -2995,10 +2879,12 @@ uint32_t __attribute__((visibility("default"))) TS_Watch_watch_channel(uint32_t LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitor monitor_conv; monitor_conv.inner = (void*)(monitor & (~1)); monitor_conv.is_owned = (monitor & 1) || (monitor == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); monitor_conv = ChannelMonitor_clone(&monitor_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); @@ -3012,10 +2898,12 @@ uint32_t __attribute__((visibility("default"))) TS_Watch_update_channel(uint32_ LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = (update & 1) || (update == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); update_conv = ChannelMonitorUpdate_clone(&update_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); @@ -3139,7 +3027,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t LDKShutdownScript ret_conv; ret_conv.inner = (void*)(ret & (~1)); ret_conv.is_owned = (ret & 1) || (ret == 0); - ret_conv = ShutdownScript_clone(&ret_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); return ret_conv; } LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { @@ -3148,7 +3036,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKSign ret_conv = *(LDKSign*)(ret_ptr); - ret_conv = Sign_clone(&ret_conv); + FREE((void*)ret); return ret_conv; } LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) { @@ -3168,7 +3056,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr); - ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKCVec_u8Z invoice_preimage) { @@ -3181,7 +3069,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); - ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) { @@ -3239,6 +3127,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_shutdown_s uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3346,11 +3235,19 @@ static void LDKLogger_JCalls_free(void* this_arg) { FREE(j_calls); } } -void log_LDKLogger_jcall(const void* this_arg, const char* record) { +void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; - const char* record_str = record; - jstring record_conv = str_ref_to_ts(record_str, strlen(record_str)); - js_invoke_function_1(j_calls->log_meth, record_conv); + LDKRecord record_var = *record; + uint64_t record_ref = 0; + record_var = Record_clone(record); + CHECK((((uint64_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); + record_ref = (uint64_t)record_var.inner; + if (record_var.is_owned) { + record_ref |= 1; + } + js_invoke_function_1(j_calls->log_meth, record_ref); } static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; @@ -3392,13 +3289,11 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMana uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner & ~1; return ret_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3413,12 +3308,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHash uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3426,6 +3319,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3436,12 +3330,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_OutPointDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3449,6 +3341,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3459,6 +3352,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -3563,9 +3457,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_TypeZ_ref_from_ptr default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_COption_TypeZDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_COption_TypeZDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_TypeZDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3579,6 +3470,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_TypeZDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -3595,6 +3487,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKPaymentError_ref_from_ptr( uint64_t routing_ref = 0; CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var); routing_ref = (uint64_t)routing_var.inner & ~1; return 0 /* LDKPaymentError - Routing */; (void) routing_ref; } @@ -3605,9 +3498,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKPaymentError_ref_from_ptr( default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentErrorZ_get_ok(uint32_t arg) { LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3621,9 +3511,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentE uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SiPrefixNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_SiPrefixNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SiPrefixNoneZ_get_ok(uint32_t arg) { LDKCResult_SiPrefixNoneZ *val = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3635,9 +3522,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_SiPrefixNoneZ_get_err CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_InvoiceNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_get_ok(uint32_t arg) { LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3645,6 +3529,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_get_ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3653,9 +3538,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_get_err( CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SignedRawInvoiceNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_SignedRawInvoiceNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignedRawInvoiceNoneZ_get_ok(uint32_t arg) { LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3663,6 +3545,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignedRawInvoiceN uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3680,6 +3563,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3706,6 +3590,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3713,9 +3598,6 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi return ret_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PayeePubKeyErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ_get_ok(uint32_t arg) { LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3723,6 +3605,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3732,25 +3615,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_PrivateRouteZ_new(uint32_tArray elems) { - LDKCVec_PrivateRouteZ *ret = MALLOC(sizeof(LDKCVec_PrivateRouteZ), "LDKCVec_PrivateRouteZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKPrivateRoute) * ret->datalen, "LDKCVec_PrivateRouteZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKPrivateRoute arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = PrivateRoute_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3758,9 +3622,6 @@ static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_Priva } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestampCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PositiveTimestampCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestampCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3768,6 +3629,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestamp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3777,9 +3639,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestamp uint32_t err_conv = LDKCreationError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneSemanticErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneSemanticErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneSemanticErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneSemanticErrorZ *val = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3791,9 +3650,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneSemanticError uint32_t err_conv = LDKSemanticError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InvoiceSemanticErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticErrorZ_get_ok(uint32_t arg) { LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3801,6 +3657,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticEr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3810,9 +3667,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticEr uint32_t err_conv = LDKSemanticError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_DescriptionCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3820,6 +3674,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreati uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3829,9 +3684,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreati uint32_t err_conv = LDKCreationError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ExpiryTimeCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3839,6 +3691,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreatio uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3848,9 +3701,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreatio uint32_t err_conv = LDKCreationError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PrivateRouteCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3858,6 +3708,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreat uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3867,9 +3718,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreat uint32_t err_conv = LDKCreationError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_StringErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_StringErrorZ*)arg)->result_ok; -} jstring __attribute__((visibility("default"))) TS_LDKCResult_StringErrorZ_get_ok(uint32_t arg) { LDKCResult_StringErrorZ *val = (LDKCResult_StringErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3883,9 +3731,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StringErrorZ_get_ uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3893,6 +3738,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpd uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3903,11 +3749,39 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpd uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_HTLCUpdateDecodeErrorZ*)arg)->result_ok; +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_MonitorEventZ_ref_from_ptr(uint32_t ptr) { + LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_MonitorEventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return 0 /* LDKCOption_MonitorEventZ - Some */; (void) some_ref; + } + case LDKCOption_MonitorEventZ_None: { + return 0 /* LDKCOption_MonitorEventZ - None */; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint32_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err(uint32_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; } uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); @@ -3916,6 +3790,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3926,12 +3801,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3944,6 +3817,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdate uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -3956,6 +3830,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_get_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3996,25 +3871,6 @@ int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_get_b( return ret_arr; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_u32ScriptZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_u32ScriptZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32ScriptZZ), "LDKCVec_C2Tuple_u32ScriptZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * ret->datalen, "LDKCVec_C2Tuple_u32ScriptZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4051,25 +3907,6 @@ uint32_tArray __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tupl return ret_arr; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4077,166 +3914,6 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKPaymentPurpose_ref_from_ptr(uint32_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); - switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: { - int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_preimage_arr + 4), obj->invoice_payment.payment_preimage.data, 32); - int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_secret_arr + 4), obj->invoice_payment.payment_secret.data, 32); - return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr; (void) obj->invoice_payment.user_payment_id; - } - case LDKPaymentPurpose_SpontaneousPayment: { - int8_tArray spontaneous_payment_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(spontaneous_payment_arr + 4), obj->spontaneous_payment.data, 32); - return 0 /* LDKPaymentPurpose - SpontaneousPayment */; (void) spontaneous_payment_arr; - } - default: abort(); - } -} -uint32_t __attribute__((visibility("default"))) TS_LDKClosureReason_ref_from_ptr(uint32_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); - switch(obj->tag) { - case LDKClosureReason_CounterpartyForceClosed: { - LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; - jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len); - return 0 /* LDKClosureReason - CounterpartyForceClosed */; (void) peer_msg_conv; - } - case LDKClosureReason_HolderForceClosed: { - return 0 /* LDKClosureReason - HolderForceClosed */; - } - case LDKClosureReason_CooperativeClosure: { - return 0 /* LDKClosureReason - CooperativeClosure */; - } - case LDKClosureReason_CommitmentTxConfirmed: { - return 0 /* LDKClosureReason - CommitmentTxConfirmed */; - } - case LDKClosureReason_ProcessingError: { - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len); - return 0 /* LDKClosureReason - ProcessingError */; (void) err_conv; - } - case LDKClosureReason_DisconnectedPeer: { - return 0 /* LDKClosureReason - DisconnectedPeer */; - } - case LDKClosureReason_OutdatedChannelManager: { - return 0 /* LDKClosureReason - OutdatedChannelManager */; - } - default: abort(); - } -} -uint32_t __attribute__((visibility("default"))) TS_LDKEvent_ref_from_ptr(uint32_t ptr) { - LDKEvent *obj = (LDKEvent*)(ptr & ~1); - switch(obj->tag) { - case LDKEvent_FundingGenerationReady: { - int8_tArray temporary_channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(temporary_channel_id_arr + 4), obj->funding_generation_ready.temporary_channel_id.data, 32); - LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; - int8_tArray output_script_arr = init_arr(output_script_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(output_script_arr + 4), output_script_var.data, output_script_var.datalen); - return 0 /* LDKEvent - FundingGenerationReady */; (void) temporary_channel_id_arr; (void) obj->funding_generation_ready.channel_value_satoshis; (void) output_script_arr; (void) obj->funding_generation_ready.user_channel_id; - } - case LDKEvent_PaymentReceived: { - int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_received.payment_hash.data, 32); - uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; - return 0 /* LDKEvent - PaymentReceived */; (void) payment_hash_arr; (void) obj->payment_received.amt; (void) purpose_ref; - } - case LDKEvent_PaymentSent: { - int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_sent.payment_id.data, 32); - int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_preimage_arr + 4), obj->payment_sent.payment_preimage.data, 32); - int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_sent.payment_hash.data, 32); - uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; - return 0 /* LDKEvent - PaymentSent */; (void) payment_id_arr; (void) payment_preimage_arr; (void) payment_hash_arr; (void) fee_paid_msat_ref; - } - case LDKEvent_PaymentPathFailed: { - int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_path_failed.payment_id.data, 32); - int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_path_failed.payment_hash.data, 32); - uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; - LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; - uint32_tArray path_arr = NULL; - path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); - uint32_t *path_arr_ptr = (uint32_t*)(path_arr + 4); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; - path_arr_ptr[k] = path_conv_10_ref; - } - - uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; - LDKRouteParameters retry_var = obj->payment_path_failed.retry; - uint64_t retry_ref = 0; - if ((uint64_t)retry_var.inner > 4096) { - CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - retry_ref = (uint64_t)retry_var.inner & ~1; - } - return 0 /* LDKEvent - PaymentPathFailed */; (void) payment_id_arr; (void) payment_hash_arr; (void) obj->payment_path_failed.rejected_by_dest; (void) network_update_ref; (void) obj->payment_path_failed.all_paths_failed; (void) path_arr; (void) short_channel_id_ref; (void) retry_ref; - } - case LDKEvent_PendingHTLCsForwardable: { - return 0 /* LDKEvent - PendingHTLCsForwardable */; (void) obj->pending_htl_cs_forwardable.time_forwardable; - } - case LDKEvent_SpendableOutputs: { - LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; - uint32_tArray outputs_arr = NULL; - outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); - uint32_t *outputs_arr_ptr = (uint32_t*)(outputs_arr + 4); - for (size_t b = 0; b < outputs_var.datalen; b++) { - uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; - outputs_arr_ptr[b] = outputs_conv_27_ref; - } - - return 0 /* LDKEvent - SpendableOutputs */; (void) outputs_arr; - } - case LDKEvent_PaymentForwarded: { - uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; - return 0 /* LDKEvent - PaymentForwarded */; (void) fee_earned_msat_ref; (void) obj->payment_forwarded.claim_from_onchain_tx; - } - case LDKEvent_ChannelClosed: { - int8_tArray channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(channel_id_arr + 4), obj->channel_closed.channel_id.data, 32); - uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; - return 0 /* LDKEvent - ChannelClosed */; (void) channel_id_arr; (void) obj->channel_closed.user_channel_id; (void) reason_ref; - } - case LDKEvent_DiscardFunding: { - int8_tArray channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(channel_id_arr + 4), obj->discard_funding.channel_id.data, 32); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = init_arr(transaction_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(transaction_arr + 4), transaction_var.data, transaction_var.datalen); - return 0 /* LDKEvent - DiscardFunding */; (void) channel_id_arr; (void) transaction_arr; - } - default: abort(); - } -} -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_EventZ_new(uint32_tArray elems) { - LDKCVec_EventZ *ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVec_EventZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr); - arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4263,25 +3940,6 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_get_b(uint return (uint64_t)ret_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_u32TxOutZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_u32TxOutZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32TxOutZZ), "LDKCVec_C2Tuple_u32TxOutZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * ret->datalen, "LDKCVec_C2Tuple_u32TxOutZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) { LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4318,25 +3976,6 @@ uint32_tArray __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tupl return ret_arr; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4362,25 +4001,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKBalance_ref_from_ptr(uint3 default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_BalanceZ_new(uint32_tArray elems) { - LDKCVec_BalanceZ *ret = MALLOC(sizeof(LDKCVec_BalanceZ), "LDKCVec_BalanceZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKBalance) * ret->datalen, "LDKCVec_BalanceZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr); - arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) { LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4388,9 +4008,6 @@ static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4406,12 +4023,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHash uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneLightningErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneLightningErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneLightningErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4424,6 +4039,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneLightningErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -4447,25 +4063,6 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_get_b return (uint64_t)ret_ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_PublicKeyTypeZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_PublicKeyTypeZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_PublicKeyTypeZZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * ret->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) { LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4473,9 +4070,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolLightningErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok; -} jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolLightningErrorZ_get_ok(uint32_t arg) { LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4488,6 +4082,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_boolLightningErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -4500,6 +4095,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4516,6 +4112,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4532,6 +4129,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4539,25 +4137,6 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC return ret_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(uint32_tArray elems) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * ret->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr); - arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4565,25 +4144,6 @@ static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CV } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_NodeAnnouncementZ_new(uint32_tArray elems) { - LDKCVec_NodeAnnouncementZ *ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVec_NodeAnnouncementZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKNodeAnnouncement arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = NodeAnnouncement_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4591,9 +4151,6 @@ static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCV } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint32_t arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4609,12 +4166,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CVec_u8ZPeerHandl uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NonePeerHandleErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NonePeerHandleErrorZ_get_ok(uint32_t arg) { LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4627,12 +4182,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NonePeerHandleErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolPeerHandleErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok; -} jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolPeerHandleErrorZ_get_ok(uint32_t arg) { LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4645,12 +4198,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_boolPeerHandleErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeIdDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4658,6 +4209,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4668,6 +4220,24 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint32_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint32_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -4690,7 +4260,7 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); - ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) { @@ -4742,9 +4312,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_AccessZ_ref_from_p default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_DirectionalChannelInfoDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4752,6 +4319,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChanne uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4762,12 +4330,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChanne uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelInfoDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4775,6 +4341,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4785,12 +4352,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RoutingFeesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4798,6 +4363,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4808,12 +4374,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4821,6 +4385,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementI uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4831,31 +4396,15 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementI uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_u64Z_new(int64_tArray elems) { - LDKCVec_u64Z *ret = MALLOC(sizeof(LDKCVec_u64Z), "LDKCVec_u64Z"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVec_u64Z Data"); - int64_t *java_elems = (int64_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - } - return (uint64_t)ret; -} static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeInfoDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4863,6 +4412,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4873,12 +4423,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NetworkGraphDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4886,6 +4434,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4896,6 +4445,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -4920,9 +4470,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_CVec_NetAddressZZ_ default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetAddressDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetAddressDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4936,28 +4483,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetAddressDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateAddHTLCZ_new(uint32_tArray elems) { - LDKCVec_UpdateAddHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateAddHTLCZ), "LDKCVec_UpdateAddHTLCZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVec_UpdateAddHTLCZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKUpdateAddHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateAddHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) { LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4965,25 +4494,6 @@ static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_Upd } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateFulfillHTLCZ_new(uint32_tArray elems) { - LDKCVec_UpdateFulfillHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFulfillHTLCZ), "LDKCVec_UpdateFulfillHTLCZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVec_UpdateFulfillHTLCZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKUpdateFulfillHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFulfillHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) { LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4991,25 +4501,6 @@ static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDK } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateFailHTLCZ_new(uint32_tArray elems) { - LDKCVec_UpdateFailHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailHTLCZ), "LDKCVec_UpdateFailHTLCZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVec_UpdateFailHTLCZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKUpdateFailHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) { LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5017,25 +4508,6 @@ static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_U } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateFailMalformedHTLCZ_new(uint32_tArray elems) { - LDKCVec_UpdateFailMalformedHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailMalformedHTLCZ), "LDKCVec_UpdateFailMalformedHTLCZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVec_UpdateFailMalformedHTLCZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKUpdateFailMalformedHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailMalformedHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) { LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5043,9 +4515,6 @@ static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clo } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_AcceptChannelDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5053,6 +4522,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5063,12 +4533,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_AnnouncementSignaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5076,6 +4544,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSigna uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5086,12 +4555,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSigna uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelReestablishDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5099,6 +4566,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablis uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5109,12 +4577,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablis uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ClosingSignedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5122,6 +4588,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5132,12 +4599,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5145,6 +4610,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeR uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5155,12 +4621,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeR uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CommitmentSignedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5168,6 +4632,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5178,12 +4643,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_FundingCreatedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5191,6 +4654,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5201,12 +4665,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_FundingSignedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5214,6 +4676,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5224,12 +4687,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_FundingLockedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5237,6 +4698,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5247,12 +4709,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InitDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5260,6 +4720,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5270,12 +4731,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_OpenChannelDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5283,6 +4742,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5293,12 +4753,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RevokeAndACKDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5306,6 +4764,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5316,12 +4775,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ShutdownDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5329,6 +4786,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5339,12 +4797,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateFailHTLCDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5352,6 +4808,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5362,12 +4819,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5375,6 +4830,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalform uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5385,12 +4841,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalform uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateFeeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5398,6 +4852,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeEr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5408,12 +4863,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5421,6 +4874,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLC uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5431,12 +4885,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLC uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateAddHTLCDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5444,6 +4896,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5454,12 +4907,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PingDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5467,6 +4918,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5477,12 +4929,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PongDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5490,6 +4940,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5500,12 +4951,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5513,6 +4962,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAn uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5523,12 +4973,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAn uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5536,6 +4984,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnounceme uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5546,12 +4995,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnounceme uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5559,6 +5006,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5569,12 +5017,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUp uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelUpdateDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5582,6 +5028,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5592,12 +5039,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ErrorMessageDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5605,6 +5050,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5615,12 +5061,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5628,6 +5072,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnou uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5638,12 +5083,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnou uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5651,6 +5094,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5661,12 +5105,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5674,6 +5116,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5684,12 +5127,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5697,6 +5138,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5707,12 +5149,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_QueryChannelRangeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5720,6 +5160,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRange uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5730,12 +5171,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRange uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5743,6 +5182,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRange uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5753,12 +5193,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRange uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5766,6 +5204,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFi uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5776,6 +5215,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFi uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5792,9 +5232,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSignOrCreationError_ref_fr default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSignOrCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InvoiceSignOrCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSignOrCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5802,6 +5239,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSignOrCrea uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5839,6 +5277,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void uint64_t output_ref = 0; CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = (uint64_t)output_var.inner; if (output_var.is_owned) { output_ref |= 1; @@ -5847,7 +5286,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr); - ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) { @@ -5893,6 +5332,7 @@ uint32_t __attribute__((visibility("default"))) TS_Filter_register_output(uint3 LDKWatchedOutput output_conv; output_conv.inner = (void*)(output & (~1)); output_conv.is_owned = (output & 1) || (output == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv); output_conv = WatchedOutput_clone(&output_conv); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); @@ -5915,9 +5355,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_FilterZ_ref_from_p default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMonitorNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_LockedChannelMonitorNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMonitorNoneZ_get_ok(uint32_t arg) { LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5925,6 +5362,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMoni uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5933,25 +5371,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMonitorN CHECK(!val->result_ok); return *val->contents.err; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_OutPointZ_new(uint32_tArray elems) { - LDKCVec_OutPointZ *ret = MALLOC(sizeof(LDKCVec_OutPointZ), "LDKCVec_OutPointZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKOutPoint) * ret->datalen, "LDKCVec_OutPointZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKOutPoint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = OutPoint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) { LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5985,7 +5404,7 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1); CHECK_ACCESS(ret_conv_18_ptr); LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr); - ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1)); + FREE((void*)ret_conv_18); ret_constr.data[s] = ret_conv_18_conv; } return ret_constr; @@ -6367,6 +5786,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -6376,6 +5796,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -6384,6 +5805,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -6392,7 +5814,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { @@ -6401,6 +5823,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -6411,6 +5834,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal update_var = ChannelMonitorUpdate_clone(update); CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -6421,6 +5845,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -6429,6 +5854,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -6437,7 +5863,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) { @@ -6469,13 +5895,16 @@ uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel( LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv); @@ -6489,16 +5918,20 @@ uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_cha LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv); @@ -6563,6 +5996,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -6572,6 +6006,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = OpenChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6586,6 +6021,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -6595,6 +6031,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = AcceptChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6610,6 +6047,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingCreated_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6625,6 +6063,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6640,6 +6079,7 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingLocked_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6655,6 +6095,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub their_features_var = InitFeatures_clone(their_features); CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -6664,6 +6105,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = Shutdown_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6679,6 +6121,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ClosingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6694,6 +6137,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6709,6 +6153,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6724,6 +6169,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6739,6 +6185,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6754,6 +6201,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6769,6 +6217,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6784,6 +6233,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6799,6 +6249,7 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6820,6 +6271,7 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl msg_var = Init_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6835,6 +6287,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6850,6 +6303,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6865,6 +6319,7 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6924,10 +6379,12 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_ope LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -6941,10 +6398,12 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_acc LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -6958,6 +6417,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -6971,6 +6431,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -6984,6 +6445,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -6997,9 +6459,11 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_shu LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv); } @@ -7013,6 +6477,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_clo LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7026,6 +6491,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateAddHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7039,6 +6505,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateFulfillHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7052,6 +6519,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateFailHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7065,6 +6533,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateFailMalformedHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7078,6 +6547,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_com LDKCommitmentSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7091,6 +6561,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_rev LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7104,6 +6575,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateFee msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7117,6 +6589,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_ann LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7140,6 +6613,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_conne LDKInit msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7153,6 +6627,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_cha LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7166,6 +6641,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_cha LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7179,6 +6655,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_err LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7219,6 +6696,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_var = NodeAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7227,7 +6705,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) { @@ -7237,6 +6715,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_var = ChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7245,7 +6724,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) { @@ -7255,6 +6734,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7263,7 +6743,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) { @@ -7281,7 +6761,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1); CHECK_ACCESS(ret_conv_59_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr); - ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1)); + FREE((void*)ret_conv_59); ret_constr.data[h] = ret_conv_59_conv; } return ret_constr; @@ -7303,7 +6783,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j LDKNodeAnnouncement ret_conv_18_conv; ret_conv_18_conv.inner = (void*)(ret_conv_18 & (~1)); ret_conv_18_conv.is_owned = (ret_conv_18 & 1) || (ret_conv_18 == 0); - ret_conv_18_conv = NodeAnnouncement_clone(&ret_conv_18_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv); ret_constr.data[s] = ret_conv_18_conv; } return ret_constr; @@ -7317,6 +6797,7 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK init_var = Init_clone(init); CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = (uint64_t)init_var.inner; if (init_var.is_owned) { init_ref |= 1; @@ -7331,6 +6812,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7339,7 +6821,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) { @@ -7350,6 +6832,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7358,7 +6841,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) { @@ -7369,6 +6852,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7377,7 +6861,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) { @@ -7388,6 +6872,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7396,7 +6881,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) { @@ -7439,6 +6924,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -7451,6 +6937,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -7463,6 +6950,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -7502,6 +6990,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_g uint64_t ret_conv_18_ref = 0; CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var); ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner; if (ret_conv_18_var.is_owned) { ret_conv_18_ref |= 1; @@ -7523,6 +7012,7 @@ void __attribute__((visibility("default"))) TS_RoutingMessageHandler_sync_routi LDKInit init_conv; init_conv.inner = (void*)(init & (~1)); init_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv); (this_arg_conv->sync_routing_table)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); } @@ -7536,6 +7026,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -7552,6 +7043,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKReplyShortChannelIdsEnd msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -7568,6 +7060,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -7584,6 +7077,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -7610,7 +7104,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); - ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) { @@ -7670,7 +7164,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) { @@ -7688,7 +7182,7 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1); CHECK_ACCESS(ret_conv_25_ptr); LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr); - ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1)); + FREE((void*)ret_conv_25); ret_constr.data[z] = ret_conv_25_conv; } return ret_constr; @@ -7862,6 +7356,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor source_var = NodeId_clone(source); CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); source_ref = (uint64_t)source_var.inner; if (source_var.is_owned) { source_ref |= 1; @@ -7871,6 +7366,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor target_var = NodeId_clone(target); CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); target_ref = (uint64_t)target_var.inner; if (target_var.is_owned) { target_ref |= 1; @@ -7888,6 +7384,7 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t path_conv_10_ref = 0; CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); path_conv_10_ref = (uint64_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; @@ -7937,9 +7434,11 @@ int64_t __attribute__((visibility("default"))) TS_Score_channel_penalty_msat(ui LDKNodeId source_conv; source_conv.inner = (void*)(source & (~1)); source_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); LDKNodeId target_conv; target_conv.inner = (void*)(target & (~1)); target_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv); return ret_val; } @@ -7960,6 +7459,7 @@ void __attribute__((visibility("default"))) TS_Score_payment_path_failed(uint32 LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -7995,6 +7495,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi // Warning: we may need a move here but no clone is available for LDKChannelManager CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = (uint64_t)channel_manager_var.inner; if (channel_manager_var.is_owned) { channel_manager_ref |= 1; @@ -8003,7 +7504,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); - ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKChannelManagerPersister_JCalls_cloned(LDKChannelManagerPersister* new_obj) { @@ -8034,6 +7535,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerPersister_pers LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); return (uint64_t)ret_conv; @@ -8102,7 +7604,7 @@ LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { LDKChannelDetails ret_conv_16_conv; ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1)); ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0); - ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); ret_constr.data[q] = ret_conv_16_conv; } return ret_constr; @@ -8114,6 +7616,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -8126,7 +7629,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) { @@ -8136,6 +7639,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -8146,7 +7650,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) { @@ -8195,6 +7699,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Payer_first_hops(uint32 uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -8213,6 +7718,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payer_send_payment(uint32_t LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32); @@ -8231,6 +7737,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payer_retry_payment(uint32_t LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(*((uint32_t*)payment_id) == 32); memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32); @@ -8259,6 +7766,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, params_var = RouteParameters_clone(params); CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); params_ref = (uint64_t)params_var.inner; if (params_var.is_owned) { params_ref |= 1; @@ -8274,6 +7782,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, uint64_t first_hops_conv_16_ref = 0; CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner; if (first_hops_conv_16_var.is_owned) { first_hops_conv_16_ref |= 1; @@ -8288,7 +7797,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); - ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) { @@ -8322,6 +7831,7 @@ uint32_t __attribute__((visibility("default"))) TS_Router_find_route(uint32_t t LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != 0) { @@ -8336,6 +7846,7 @@ uint32_t __attribute__((visibility("default"))) TS_Router_find_route(uint32_t t LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } first_hops_ptr = &first_hops_constr; @@ -8391,6 +7902,17 @@ void __attribute__((visibility("default"))) TS_TxOut_free(uint32_t _res) { TxOut_free(_res_conv); } +static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(arg); + return (uint64_t)ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_TxOut_clone_ptr(uint32_t arg) { + LDKTxOut* arg_conv = (LDKTxOut*)(arg & ~1); + int64_t ret_val = TxOut_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_TxOut_clone(uint32_t orig) { LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); @@ -8419,6 +7941,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SecretKeyErrorZ_err( return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SecretKeyErrorZ_is_ok(uint32_t o) { + LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_SecretKeyErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SecretKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8444,6 +7972,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_err( return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_is_ok(uint32_t o) { + LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PublicKeyErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8453,6 +7987,17 @@ void __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_free(uin CResult_PublicKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_clone(uint32_t orig) { LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)(orig & ~1); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); @@ -8464,6 +8009,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecode LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); @@ -8474,12 +8020,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8489,6 +8042,17 @@ void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErro CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint32_t orig) { LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); @@ -8500,6 +8064,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDec LDKChannelPublicKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelPublicKeys_clone(&o_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); @@ -8510,12 +8075,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8525,6 +8097,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeE CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); @@ -8536,6 +8119,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); @@ -8549,6 +8133,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint32_t o) { + LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8558,6 +8148,17 @@ void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_fre CResult_TxCreationKeysErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_clone(uint32_t orig) { LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); @@ -8588,6 +8189,18 @@ void __attribute__((visibility("default"))) TS_COption_u32Z_free(uint32_t _res) COption_u32Z_free(_res_conv); } +static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_u32Z_clone_ptr(uint32_t arg) { + LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)arg; + int64_t ret_val = COption_u32Z_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_u32Z_clone(uint32_t orig) { LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); @@ -8600,6 +8213,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitme LDKHTLCOutputInCommitment o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCOutputInCommitment_clone(&o_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); @@ -8610,12 +8224,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitme LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8625,6 +8246,17 @@ void __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDe CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint32_t orig) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); @@ -8636,6 +8268,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelT LDKCounterpartyChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -8646,12 +8279,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelT LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8661,6 +8301,17 @@ void __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTrans CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint32_t orig) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); @@ -8672,6 +8323,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTransactionPa LDKChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelTransactionParameters_clone(&o_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -8682,12 +8334,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTransactionPa LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8697,6 +8356,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParame CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); @@ -8726,6 +8396,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTran LDKHolderCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HolderCommitmentTransaction_clone(&o_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -8736,12 +8407,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTran LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8751,6 +8429,17 @@ void __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransact CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint32_t orig) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); @@ -8762,6 +8451,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTrans LDKBuiltCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = BuiltCommitmentTransaction_clone(&o_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -8772,12 +8462,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTrans LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8787,6 +8484,17 @@ void __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransacti CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint32_t orig) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); @@ -8798,6 +8506,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransa LDKTrustedClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedClosingTransaction LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); @@ -8810,6 +8519,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransa return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint32_t o) { + LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8823,6 +8538,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentTransactio LDKCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentTransaction_clone(&o_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -8833,12 +8549,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentTransactio LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8848,6 +8571,17 @@ void __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDec CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint32_t orig) { LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); @@ -8859,6 +8593,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTra LDKTrustedCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedCommitmentTransaction LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); @@ -8871,6 +8606,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTra return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint32_t o) { + LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8906,6 +8647,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint32_t o) { + LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_SignatureZNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8915,6 +8662,17 @@ void __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_fre CResult_CVec_SignatureZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_clone(uint32_t orig) { LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)(orig & ~1); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); @@ -8926,6 +8684,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecode LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); @@ -8936,12 +8695,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8951,6 +8717,17 @@ void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErro CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); @@ -8962,6 +8739,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvali LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); @@ -8972,12 +8750,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvali LDKInvalidShutdownScript e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = InvalidShutdownScript_clone(&e_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint32_t o) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8987,6 +8772,17 @@ void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShu CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint32_t arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint32_t orig) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); @@ -9007,6 +8803,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_err(uint3 return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9016,6 +8818,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_free(uint32_t CResult_NoneErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_clone(uint32_t orig) { LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)(orig & ~1); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); @@ -9027,6 +8840,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHop_clone(&o_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv); @@ -9037,12 +8851,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9052,6 +8873,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_fre CResult_RouteHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); @@ -9072,6 +8904,7 @@ void __attribute__((visibility("default"))) TS_CVec_RouteHopZ_free(uint32_tArra LDKRouteHop _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } CVec_RouteHopZ_free(_res_constr); @@ -9099,6 +8932,7 @@ void __attribute__((visibility("default"))) TS_CVec_CVec_RouteHopZZ_free(ptrArr LDKRouteHop _res_conv_12_conv_10_conv; _res_conv_12_conv_10_conv.inner = (void*)(_res_conv_12_conv_10 & (~1)); _res_conv_12_conv_10_conv.is_owned = (_res_conv_12_conv_10 & 1) || (_res_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv); _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv; } _res_constr.data[m] = _res_conv_12_constr; @@ -9110,6 +8944,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_ok LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv); @@ -9120,12 +8955,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_er LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9135,6 +8977,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_free(u CResult_RouteDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = CResult_RouteDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)(orig & ~1); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); @@ -9146,6 +8999,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecod LDKRouteParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteParameters_clone(&o_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv); @@ -9156,12 +9010,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9171,6 +9032,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErr CResult_RouteParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); @@ -9191,6 +9063,7 @@ void __attribute__((visibility("default"))) TS_CVec_RouteHintZ_free(uint32_tArr LDKRouteHint _res_conv_11_conv; _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1)); _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv); _res_constr.data[l] = _res_conv_11_conv; } CVec_RouteHintZ_free(_res_constr); @@ -9219,6 +9092,18 @@ void __attribute__((visibility("default"))) TS_COption_u64Z_free(uint32_t _res) COption_u64Z_free(_res_conv); } +static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_u64Z_clone_ptr(uint32_t arg) { + LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)arg; + int64_t ret_val = COption_u64Z_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_u64Z_clone(uint32_t orig) { LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); @@ -9231,6 +9116,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_ok LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Payee_clone(&o_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv); @@ -9241,12 +9127,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_er LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_PayeeDecodeErrorZ* o_conv = (LDKCResult_PayeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9256,6 +9149,17 @@ void __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_free(u CResult_PayeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); + *ret_conv = CResult_PayeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PayeeDecodeErrorZ* arg_conv = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); @@ -9276,6 +9180,7 @@ void __attribute__((visibility("default"))) TS_CVec_RouteHintHopZ_free(uint32_t LDKRouteHintHop _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } CVec_RouteHintHopZ_free(_res_constr); @@ -9285,6 +9190,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeError LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHint_clone(&o_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv); @@ -9295,12 +9201,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeError LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9310,6 +9223,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_fr CResult_RouteHintDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); @@ -9321,6 +9245,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeEr LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHintHop_clone(&o_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv); @@ -9331,12 +9256,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9346,6 +9278,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); @@ -9366,6 +9309,7 @@ void __attribute__((visibility("default"))) TS_CVec_ChannelDetailsZ_free(uint32 LDKChannelDetails _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } CVec_ChannelDetailsZ_free(_res_constr); @@ -9375,6 +9319,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); @@ -9385,14 +9330,21 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } -void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) { - if ((_res & 1) != 0) return; +jboolean __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteLightningErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr); @@ -9400,6 +9352,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_fre CResult_RouteLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_clone(uint32_t orig) { LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); @@ -9424,6 +9387,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_er return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint32_t o) { + LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxOutAccessErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9433,6 +9402,17 @@ void __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_free(u CResult_TxOutAccessErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_clone(uint32_t orig) { LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); @@ -9440,6 +9420,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_cl return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); + int64_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ_clone(uint32_t orig) { LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); @@ -9517,6 +9508,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUp return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint32_t o) { + LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); + jboolean ret_val = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9526,6 +9523,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdate CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); } +static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); + int64_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone(uint32_t orig) { LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); @@ -9579,6 +9587,18 @@ void __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransaction COption_C2Tuple_usizeTransactionZZ_free(_res_conv); } +static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint32_t arg) { + LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; + int64_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_clone(uint32_t orig) { LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); @@ -9587,6 +9607,107 @@ uint32_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransac return ret_ref; } +uint32_t __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_some(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); + o_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)o) & ~1)); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_none() { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); + FREE((void*)_res); + COption_ClosureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_clone_ptr(uint32_t arg) { + LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)arg; + int64_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_clone(uint32_t orig) { + LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)orig; + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint32_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +jboolean __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + uint32_t __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_some(uint32_t o) { void* o_ptr = (void*)(((uint64_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -9614,6 +9735,18 @@ void __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_free(uint COption_NetworkUpdateZ_free(_res_conv); } +static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) { + LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); + *ret_copy = COption_NetworkUpdateZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_clone_ptr(uint32_t arg) { + LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)arg; + int64_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_clone(uint32_t orig) { LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)orig; LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); @@ -9641,6 +9774,107 @@ void __attribute__((visibility("default"))) TS_CVec_SpendableOutputDescriptorZ_ CVec_SpendableOutputDescriptorZ_free(_res_constr); } +uint32_t __attribute__((visibility("default"))) TS_COption_EventZ_some(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKEvent o_conv = *(LDKEvent*)(o_ptr); + o_conv = Event_clone((LDKEvent*)(((uint64_t)o) & ~1)); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_EventZ_none() { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_EventZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); + FREE((void*)_res); + COption_EventZ_free(_res_conv); +} + +static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_EventZ_clone_ptr(uint32_t arg) { + LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)arg; + int64_t ret_val = COption_EventZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_EventZ_clone(uint32_t orig) { + LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)orig; + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint32_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +jboolean __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + void __attribute__((visibility("default"))) TS_CVec_MessageSendEventZ_free(uint32_tArray _res) { LDKCVec_MessageSendEventZ _res_constr; _res_constr.datalen = *((uint32_t*)_res); @@ -9664,6 +9898,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeEr LDKInitFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InitFeatures_clone(&o_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); @@ -9674,12 +9909,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9693,6 +9935,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeEr LDKNodeFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeFeatures_clone(&o_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); @@ -9703,12 +9946,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9722,6 +9972,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecod LDKChannelFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelFeatures_clone(&o_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); @@ -9732,12 +9983,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9751,6 +10009,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecod LDKInvoiceFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InvoiceFeatures_clone(&o_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); @@ -9761,12 +10020,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9780,6 +10046,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDec LDKScoringParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); @@ -9790,12 +10057,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9809,6 +10083,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_o LDKScorer o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScorer LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv); @@ -9819,12 +10094,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_e LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9838,6 +10120,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutput LDKDelayedPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -9848,12 +10131,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutput LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9863,6 +10153,17 @@ void __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDesc CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(uint32_t orig) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); @@ -9874,6 +10175,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputD LDKStaticPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -9884,12 +10186,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9899,6 +10208,17 @@ void __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescr CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(uint32_t orig) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); @@ -9920,12 +10240,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9935,6 +10262,17 @@ void __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescripto CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone(uint32_t orig) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); @@ -9954,6 +10292,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_err() { return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_is_ok(uint32_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)(o & ~1); + jboolean ret_val = CResult_NoneNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9963,6 +10307,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_free(uint32_t CResult_NoneNoneZ_free(_res_conv); } +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)(arg & ~1); + int64_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_clone(uint32_t orig) { LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)(orig & ~1); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); @@ -9970,6 +10325,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_clone(uint return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone(uint32_t orig) { LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); @@ -10025,6 +10391,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVe return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint32_t o) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10034,6 +10406,17 @@ void __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_Si CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(uint32_t orig) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); @@ -10056,6 +10439,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_err() return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_is_ok(uint32_t o) { + LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignatureNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10065,6 +10454,17 @@ void __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_free(uint CResult_SignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_clone(uint32_t orig) { LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); @@ -10085,12 +10485,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_err LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SignDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10100,6 +10507,17 @@ void __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_free(ui CResult_SignDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_clone(uint32_t orig) { LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); @@ -10130,6 +10548,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RecoverableSignature return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint32_t o) { + LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10139,6 +10563,17 @@ void __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNone CResult_RecoverableSignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_clone(uint32_t orig) { LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); @@ -10192,6 +10627,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_ return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint32_t o) { + LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10201,6 +10642,17 @@ void __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone(uint32_t orig) { LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); @@ -10212,6 +10664,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecode LDKInMemorySigner o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InMemorySigner_clone(&o_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); @@ -10222,12 +10675,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10237,6 +10697,17 @@ void __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErro CResult_InMemorySignerDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_clone(uint32_t orig) { LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); @@ -10280,6 +10751,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_err return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_is_ok(uint32_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10289,6 +10766,17 @@ void __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_free(ui CResult_TransactionNoneZ_free(_res_conv); } +static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); + int64_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_clone(uint32_t orig) { LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); @@ -10296,6 +10784,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_clo return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); + int64_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone(uint32_t orig) { LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); @@ -10310,6 +10809,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMoni LDKChannelMonitor b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelMonitor_clone(&b_conv); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); @@ -10372,6 +10872,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHa return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(uint32_t o) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10381,6 +10887,17 @@ void __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashCh CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(uint32_t orig) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); @@ -10411,6 +10928,18 @@ void __attribute__((visibility("default"))) TS_COption_u16Z_free(uint32_t _res) COption_u16Z_free(_res_conv); } +static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_u16Z_clone_ptr(uint32_t arg) { + LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; + int64_t ret_val = COption_u16Z_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_u16Z_clone(uint32_t orig) { LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); @@ -10435,6 +10964,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_err(ui return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneAPIErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10444,6 +10979,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_free(uint3 CResult_NoneAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_clone(uint32_t orig) { LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)(orig & ~1); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); @@ -10508,6 +11054,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_err(u return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_is_ok(uint32_t o) { + LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); + jboolean ret_val = CResult__u832APIErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10517,6 +11069,17 @@ void __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_free(uint CResult__u832APIErrorZ_free(_res_conv); } +static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_clone_ptr(uint32_t arg) { + LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); + int64_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_clone(uint32_t orig) { LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); @@ -10543,6 +11106,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSend return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint32_t o) { + LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10552,6 +11121,17 @@ void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFail CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint32_t arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone(uint32_t orig) { LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); @@ -10575,6 +11155,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailu return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint32_t o) { + LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_NonePaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10584,6 +11170,17 @@ void __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_ CResult_NonePaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint32_t arg) { + LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_clone(uint32_t orig) { LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)(orig & ~1); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); @@ -10591,6 +11188,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailu return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone(uint32_t orig) { LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); @@ -10639,6 +11247,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashP return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint32_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10648,6 +11262,17 @@ void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPayme CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint32_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(uint32_t orig) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); @@ -10674,6 +11299,17 @@ void __attribute__((visibility("default"))) TS_CVec_NetAddressZ_free(uint32_tAr CVec_NetAddressZ_free(_res_constr); } +static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone(uint32_t orig) { LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); @@ -10721,6 +11357,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErro return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint32_t o) { + LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10730,6 +11372,17 @@ void __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_f CResult_PaymentSecretAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_clone(uint32_t orig) { LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); @@ -10750,6 +11403,7 @@ void __attribute__((visibility("default"))) TS_CVec_ChannelMonitorZ_free(uint32 LDKChannelMonitor _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } CVec_ChannelMonitorZ_free(_res_constr); @@ -10762,6 +11416,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMana LDKChannelManager b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); // Warning: we need a move here but no clone is available for LDKChannelManager LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); @@ -10791,12 +11446,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashCha LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10810,6 +11472,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeE LDKChannelConfig o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelConfig_clone(&o_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); @@ -10820,12 +11483,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10835,6 +11505,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeError CResult_ChannelConfigDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); @@ -10846,6 +11527,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OutPoint_clone(&o_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); @@ -10856,12 +11538,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OutPointDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10871,6 +11560,17 @@ void __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_fre CResult_OutPointDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_clone(uint32_t orig) { LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); @@ -10904,6 +11604,18 @@ void __attribute__((visibility("default"))) TS_COption_TypeZ_free(uint32_t _res COption_TypeZ_free(_res_conv); } +static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_TypeZ_clone_ptr(uint32_t arg) { + LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; + int64_t ret_val = COption_TypeZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_TypeZ_clone(uint32_t orig) { LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); @@ -10926,12 +11638,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10941,6 +11660,17 @@ void __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeError CResult_COption_TypeZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_clone(uint32_t orig) { LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); @@ -10967,6 +11697,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErro return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_is_ok(uint32_t o) { + LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10976,6 +11712,17 @@ void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_f CResult_PaymentIdPaymentErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint32_t orig) { LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); @@ -10996,6 +11743,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_err() return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_is_ok(uint32_t o) { + LDKCResult_SiPrefixNoneZ* o_conv = (LDKCResult_SiPrefixNoneZ*)(o & ~1); + jboolean ret_val = CResult_SiPrefixNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11005,6 +11758,17 @@ void __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_free(uint3 CResult_SiPrefixNoneZ_free(_res_conv); } +static inline uint64_t CResult_SiPrefixNoneZ_clone_ptr(LDKCResult_SiPrefixNoneZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); + *ret_conv = CResult_SiPrefixNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_SiPrefixNoneZ* arg_conv = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SiPrefixNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_clone(uint32_t orig) { LDKCResult_SiPrefixNoneZ* orig_conv = (LDKCResult_SiPrefixNoneZ*)(orig & ~1); LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); @@ -11016,6 +11780,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_ok(uint LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); *ret_conv = CResult_InvoiceNoneZ_ok(o_conv); @@ -11028,6 +11793,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_err() { return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_is_ok(uint32_t o) { + LDKCResult_InvoiceNoneZ* o_conv = (LDKCResult_InvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11037,6 +11808,17 @@ void __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_free(uint32 CResult_InvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceNoneZ_clone_ptr(LDKCResult_InvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); + *ret_conv = CResult_InvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_InvoiceNoneZ* arg_conv = (LDKCResult_InvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_clone(uint32_t orig) { LDKCResult_InvoiceNoneZ* orig_conv = (LDKCResult_InvoiceNoneZ*)(orig & ~1); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); @@ -11048,6 +11830,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNone LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = SignedRawInvoice_clone(&o_conv); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); *ret_conv = CResult_SignedRawInvoiceNoneZ_ok(o_conv); @@ -11060,6 +11843,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNone return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_is_ok(uint32_t o) { + LDKCResult_SignedRawInvoiceNoneZ* o_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignedRawInvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11069,6 +11858,17 @@ void __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_fr CResult_SignedRawInvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignedRawInvoiceNoneZ_clone_ptr(LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); + *ret_conv = CResult_SignedRawInvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_SignedRawInvoiceNoneZ* arg_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignedRawInvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_clone(uint32_t orig) { LDKCResult_SignedRawInvoiceNoneZ* orig_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(orig & ~1); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); @@ -11076,6 +11876,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNone return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint32_t arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); + int64_t ret_val = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint32_t orig) { LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); @@ -11087,6 +11898,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = RawInvoice_clone(&a_conv); LDKThirtyTwoBytes b_ref; CHECK(*((uint32_t*)b) == 32); @@ -11094,6 +11906,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi LDKInvoiceSignature c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = InvoiceSignature_clone(&c_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); @@ -11113,6 +11926,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_ok LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PayeePubKey_clone(&o_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); @@ -11126,6 +11940,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_er return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint32_t o) { + LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeePubKeyErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11135,6 +11955,17 @@ void __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_free(u CResult_PayeePubKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_clone(uint32_t orig) { LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); @@ -11155,6 +11986,7 @@ void __attribute__((visibility("default"))) TS_CVec_PrivateRouteZ_free(uint32_t LDKPrivateRoute _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } CVec_PrivateRouteZ_free(_res_constr); @@ -11164,6 +11996,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCre LDKPositiveTimestamp o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PositiveTimestamp_clone(&o_conv); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); @@ -11177,6 +12010,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCre return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11186,6 +12025,17 @@ void __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreatio CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint32_t orig) { LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); @@ -11206,6 +12056,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_e return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11215,6 +12071,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_free( CResult_NoneSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_clone(uint32_t orig) { LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); @@ -11226,6 +12093,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticError LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); @@ -11239,6 +12107,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticError return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint32_t o) { + LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11248,6 +12122,17 @@ void __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_fr CResult_InvoiceSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint32_t orig) { LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); @@ -11259,6 +12144,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DescriptionCreationE LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Description_clone(&o_conv); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); @@ -11272,6 +12158,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DescriptionCreationE return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_DescriptionCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11281,6 +12173,17 @@ void __attribute__((visibility("default"))) TS_CResult_DescriptionCreationError CResult_DescriptionCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_clone(uint32_t orig) { LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); @@ -11292,6 +12195,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationEr LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ExpiryTime_clone(&o_conv); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); *ret_conv = CResult_ExpiryTimeCreationErrorZ_ok(o_conv); @@ -11305,6 +12209,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationEr return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_ExpiryTimeCreationErrorZ* o_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_ExpiryTimeCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11314,6 +12224,17 @@ void __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_ExpiryTimeCreationErrorZ_clone_ptr(LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); + *ret_conv = CResult_ExpiryTimeCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ExpiryTimeCreationErrorZ* arg_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ExpiryTimeCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_clone(uint32_t orig) { LDKCResult_ExpiryTimeCreationErrorZ* orig_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(orig & ~1); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); @@ -11325,6 +12246,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreation LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PrivateRoute_clone(&o_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); @@ -11338,6 +12260,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreation return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11347,6 +12275,17 @@ void __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErro CResult_PrivateRouteCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint32_t orig) { LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); @@ -11368,6 +12307,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_StringErrorZ_err(uin return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_StringErrorZ_is_ok(uint32_t o) { + LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); + jboolean ret_val = CResult_StringErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_StringErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11381,6 +12326,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdate LDKChannelMonitorUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelMonitorUpdate_clone(&o_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); @@ -11391,12 +12337,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdate LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11406,6 +12359,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDeco CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); @@ -11413,10 +12377,112 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdate return (uint64_t)ret_conv; } +uint32_t __attribute__((visibility("default"))) TS_COption_MonitorEventZ_some(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)o) & ~1)); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_MonitorEventZ_none() { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_MonitorEventZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); + FREE((void*)_res); + COption_MonitorEventZ_free(_res_conv); +} + +static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_MonitorEventZ_clone_ptr(uint32_t arg) { + LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; + int64_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_MonitorEventZ_clone(uint32_t orig) { + LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint32_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +jboolean __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint32_t o) { LDKHTLCUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCUpdate_clone(&o_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); @@ -11427,12 +12493,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11442,6 +12515,17 @@ void __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_f CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone(uint32_t orig) { LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); @@ -11459,12 +12543,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErr LDKMonitorUpdateError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = MonitorUpdateError_clone(&e_conv); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11474,6 +12565,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_ CResult_NoneMonitorUpdateErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); + *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_clone(uint32_t orig) { LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); @@ -11481,6 +12583,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErr return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_clone(uint32_t orig) { LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); @@ -11492,6 +12605,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_new( LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKCVec_u8Z b_ref; b_ref.datalen = *((uint32_t*)b); @@ -11511,6 +12625,17 @@ void __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_free(uin C2Tuple_OutPointScriptZ_free(_res_conv); } +static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_clone(uint32_t orig) { LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); @@ -11556,6 +12681,17 @@ void __attribute__((visibility("default"))) TS_CVec_C2Tuple_u32ScriptZZ_free(ui CVec_C2Tuple_u32ScriptZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(uint32_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); @@ -11654,6 +12790,17 @@ void __attribute__((visibility("default"))) TS_CVec_TransactionZ_free(ptrArray CVec_TransactionZ_free(_res_constr); } +static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_clone(uint32_t orig) { LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); @@ -11699,6 +12846,17 @@ void __attribute__((visibility("default"))) TS_CVec_C2Tuple_u32TxOutZZ_free(uin CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(uint32_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); @@ -11791,12 +12949,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashCha LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11806,6 +12971,17 @@ void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannel CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(uint32_t orig) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); @@ -11823,12 +12999,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_ LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneLightningErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11838,6 +13021,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_free CResult_NoneLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_clone(uint32_t orig) { LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); @@ -11845,6 +13039,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_ return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint32_t orig) { LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); @@ -11902,12 +13107,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_ LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_is_ok(uint32_t o) { + LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolLightningErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11917,6 +13129,17 @@ void __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_free CResult_boolLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_clone(uint32_t orig) { LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); @@ -11924,6 +13147,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_ return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint32_t arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); + int64_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(uint32_t orig) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); @@ -11935,14 +13169,17 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC LDKChannelAnnouncement a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = ChannelAnnouncement_clone(&a_conv); LDKChannelUpdate b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelUpdate_clone(&b_conv); LDKChannelUpdate c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = ChannelUpdate_clone(&c_conv); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); @@ -11990,6 +13227,7 @@ void __attribute__((visibility("default"))) TS_CVec_NodeAnnouncementZ_free(uint LDKNodeAnnouncement _res_conv_18_conv; _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); _res_constr.data[s] = _res_conv_18_conv; } CVec_NodeAnnouncementZ_free(_res_constr); @@ -12027,12 +13265,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleEr LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint32_t o) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12042,6 +13287,17 @@ void __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint32_t orig) { LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); @@ -12059,12 +13315,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint32_t o) { + LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_NonePeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12074,6 +13337,17 @@ void __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_fre CResult_NonePeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_clone(uint32_t orig) { LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); @@ -12091,12 +13365,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint32_t o) { + LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12106,6 +13387,17 @@ void __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_fre CResult_boolPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_clone(uint32_t orig) { LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); @@ -12117,6 +13409,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_o LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeId_clone(&o_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); @@ -12127,25 +13420,97 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_e LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +jboolean __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_NodeIdDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint32_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } -void __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_free(uint32_t _res) { +jboolean __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NodeIdDecodeErrorZ_free(_res_conv); + CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); } -uint32_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint32_t orig) { - LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); +static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); return (uint64_t)ret_conv; } @@ -12179,6 +13544,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelIn LDKDirectionalChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DirectionalChannelInfo_clone(&o_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_ok(o_conv); @@ -12189,12 +13555,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelIn LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* o_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12204,6 +13577,17 @@ void __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDe CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); + *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone(uint32_t orig) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); @@ -12215,6 +13599,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErr LDKChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelInfo_clone(&o_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); @@ -12225,12 +13610,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12240,6 +13632,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_ CResult_ChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); @@ -12251,6 +13654,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErr LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RoutingFees_clone(&o_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); @@ -12261,12 +13665,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12276,6 +13687,17 @@ void __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_ CResult_RoutingFeesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); @@ -12287,6 +13709,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfo LDKNodeAnnouncementInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncementInfo_clone(&o_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); @@ -12297,12 +13720,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfo LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12312,6 +13742,17 @@ void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDeco CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); @@ -12338,6 +13779,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ LDKNodeInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeInfo_clone(&o_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); @@ -12348,12 +13790,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12363,6 +13812,17 @@ void __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_fre CResult_NodeInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); @@ -12374,6 +13834,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeEr LDKNetworkGraph o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NetworkGraph_clone(&o_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); @@ -12384,12 +13845,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12399,6 +13867,17 @@ void __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); @@ -12444,6 +13923,18 @@ void __attribute__((visibility("default"))) TS_COption_CVec_NetAddressZZ_free(u COption_CVec_NetAddressZZ_free(_res_conv); } +static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint32_t arg) { + LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; + int64_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_CVec_NetAddressZZ_clone(uint32_t orig) { LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); @@ -12466,12 +13957,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetAddressDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12481,6 +13979,17 @@ void __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_f CResult_NetAddressDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); @@ -12501,6 +14010,7 @@ void __attribute__((visibility("default"))) TS_CVec_UpdateAddHTLCZ_free(uint32_ LDKUpdateAddHTLC _res_conv_15_conv; _res_conv_15_conv.inner = (void*)(_res_conv_15 & (~1)); _res_conv_15_conv.is_owned = (_res_conv_15 & 1) || (_res_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv); _res_constr.data[p] = _res_conv_15_conv; } CVec_UpdateAddHTLCZ_free(_res_constr); @@ -12519,6 +14029,7 @@ void __attribute__((visibility("default"))) TS_CVec_UpdateFulfillHTLCZ_free(uin LDKUpdateFulfillHTLC _res_conv_19_conv; _res_conv_19_conv.inner = (void*)(_res_conv_19 & (~1)); _res_conv_19_conv.is_owned = (_res_conv_19 & 1) || (_res_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); _res_constr.data[t] = _res_conv_19_conv; } CVec_UpdateFulfillHTLCZ_free(_res_constr); @@ -12537,6 +14048,7 @@ void __attribute__((visibility("default"))) TS_CVec_UpdateFailHTLCZ_free(uint32 LDKUpdateFailHTLC _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } CVec_UpdateFailHTLCZ_free(_res_constr); @@ -12555,6 +14067,7 @@ void __attribute__((visibility("default"))) TS_CVec_UpdateFailMalformedHTLCZ_fr LDKUpdateFailMalformedHTLC _res_conv_25_conv; _res_conv_25_conv.inner = (void*)(_res_conv_25 & (~1)); _res_conv_25_conv.is_owned = (_res_conv_25 & 1) || (_res_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv); _res_constr.data[z] = _res_conv_25_conv; } CVec_UpdateFailMalformedHTLCZ_free(_res_constr); @@ -12564,6 +14077,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeE LDKAcceptChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AcceptChannel_clone(&o_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv); @@ -12574,12 +14088,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12589,6 +14110,17 @@ void __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeError CResult_AcceptChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint32_t orig) { LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(orig & ~1); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); @@ -12600,6 +14132,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_AnnouncementSignatur LDKAnnouncementSignatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AnnouncementSignatures_clone(&o_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv); @@ -12610,12 +14143,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_AnnouncementSignatur LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12625,6 +14165,17 @@ void __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDe CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint32_t orig) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(orig & ~1); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); @@ -12636,6 +14187,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDe LDKChannelReestablish o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelReestablish_clone(&o_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); @@ -12646,12 +14198,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDe LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12661,6 +14220,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecode CResult_ChannelReestablishDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); @@ -12672,6 +14242,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeE LDKClosingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSigned_clone(&o_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv); @@ -12682,12 +14253,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12697,6 +14275,17 @@ void __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeError CResult_ClosingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); @@ -12708,6 +14297,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRang LDKClosingSignedFeeRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSignedFeeRange_clone(&o_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv); @@ -12718,12 +14308,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRang LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12733,6 +14330,17 @@ void __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDec CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); @@ -12744,6 +14352,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDeco LDKCommitmentSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentSigned_clone(&o_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv); @@ -12754,12 +14363,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12769,6 +14385,17 @@ void __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeEr CResult_CommitmentSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); @@ -12780,6 +14407,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecode LDKFundingCreated o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingCreated_clone(&o_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv); @@ -12790,12 +14418,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12805,6 +14440,17 @@ void __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErro CResult_FundingCreatedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); @@ -12816,6 +14462,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeE LDKFundingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingSigned_clone(&o_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); @@ -12826,12 +14473,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12841,6 +14495,17 @@ void __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeError CResult_FundingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); @@ -12852,6 +14517,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeE LDKFundingLocked o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingLocked_clone(&o_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); @@ -12862,12 +14528,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_FundingLockedDecodeErrorZ* o_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingLockedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12877,6 +14550,17 @@ void __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeError CResult_FundingLockedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); + *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); @@ -12888,6 +14572,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_ok( LDKInit o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Init_clone(&o_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); @@ -12898,12 +14583,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_err LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12913,6 +14605,17 @@ void __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_free(ui CResult_InitDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_clone(uint32_t orig) { LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)(orig & ~1); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); @@ -12924,6 +14627,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErr LDKOpenChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OpenChannel_clone(&o_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); @@ -12934,12 +14638,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12949,6 +14660,17 @@ void __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_ CResult_OpenChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint32_t orig) { LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(orig & ~1); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); @@ -12960,6 +14682,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeEr LDKRevokeAndACK o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RevokeAndACK_clone(&o_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); @@ -12970,12 +14693,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12985,6 +14715,17 @@ void __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(orig & ~1); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); @@ -12996,6 +14737,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ LDKShutdown o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Shutdown_clone(&o_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); @@ -13006,12 +14748,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13021,6 +14770,17 @@ void __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_fre CResult_ShutdownDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); @@ -13032,6 +14792,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecode LDKUpdateFailHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailHTLC_clone(&o_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); @@ -13042,12 +14803,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13057,6 +14825,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErro CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); @@ -13068,6 +14847,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedH LDKUpdateFailMalformedHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailMalformedHTLC_clone(&o_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv); @@ -13078,12 +14858,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedH LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13093,6 +14880,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCD CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); @@ -13104,6 +14902,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeError LDKUpdateFee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFee_clone(&o_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv); @@ -13114,12 +14913,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeError LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13129,6 +14935,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_fr CResult_UpdateFeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); + *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); @@ -13140,6 +14957,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDec LDKUpdateFulfillHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFulfillHTLC_clone(&o_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv); @@ -13150,12 +14968,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13165,6 +14990,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeE CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); @@ -13176,6 +15012,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeE LDKUpdateAddHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateAddHTLC_clone(&o_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv); @@ -13186,12 +15023,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13201,6 +15045,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeError CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); @@ -13212,6 +15067,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_ok( LDKPing o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Ping_clone(&o_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv); @@ -13222,12 +15078,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_err LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PingDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13237,6 +15100,17 @@ void __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_free(ui CResult_PingDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = CResult_PingDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_clone(uint32_t orig) { LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)(orig & ~1); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); @@ -13248,6 +15122,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_ok( LDKPong o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Pong_clone(&o_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv); @@ -13258,12 +15133,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_err LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PongDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13273,6 +15155,17 @@ void __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_free(ui CResult_PongDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = CResult_PongDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_clone(uint32_t orig) { LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)(orig & ~1); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); @@ -13284,6 +15177,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnou LDKUnsignedChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelAnnouncement_clone(&o_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -13294,12 +15188,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnou LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13309,6 +15210,17 @@ void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncem CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); @@ -13320,6 +15232,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementD LDKChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelAnnouncement_clone(&o_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -13330,12 +15243,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13345,6 +15265,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecod CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); @@ -13356,6 +15287,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdat LDKUnsignedChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelUpdate_clone(&o_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv); @@ -13366,12 +15298,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdat LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13381,6 +15320,17 @@ void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDec CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); @@ -13392,6 +15342,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeE LDKChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelUpdate_clone(&o_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv); @@ -13402,12 +15353,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13417,6 +15375,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeError CResult_ChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); @@ -13428,6 +15397,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeEr LDKErrorMessage o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ErrorMessage_clone(&o_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv); @@ -13438,12 +15408,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13453,6 +15430,17 @@ void __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(orig & ~1); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); @@ -13464,6 +15452,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnounce LDKUnsignedNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedNodeAnnouncement_clone(&o_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -13474,12 +15463,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnounce LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13489,6 +15485,17 @@ void __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); @@ -13500,6 +15507,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDeco LDKNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncement_clone(&o_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -13510,12 +15518,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13525,6 +15540,17 @@ void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeEr CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); @@ -13536,6 +15562,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIds LDKQueryShortChannelIds o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryShortChannelIds_clone(&o_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv); @@ -13546,12 +15573,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIds LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13561,6 +15595,17 @@ void __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDeco CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone(uint32_t orig) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(orig & ~1); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); @@ -13572,6 +15617,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIds LDKReplyShortChannelIdsEnd o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyShortChannelIdsEnd_clone(&o_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv); @@ -13582,12 +15628,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIds LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13597,6 +15650,17 @@ void __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndD CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); @@ -13608,6 +15672,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDec LDKQueryChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryChannelRange_clone(&o_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv); @@ -13618,12 +15683,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13633,6 +15705,17 @@ void __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeE CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); @@ -13644,6 +15727,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDec LDKReplyChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyChannelRange_clone(&o_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv); @@ -13654,12 +15738,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13669,6 +15760,17 @@ void __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeE CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); @@ -13680,6 +15782,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilte LDKGossipTimestampFilter o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = GossipTimestampFilter_clone(&o_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv); @@ -13690,12 +15793,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilte LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13705,6 +15815,17 @@ void __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDec CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone(uint32_t orig) { LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(orig & ~1); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); @@ -13716,6 +15837,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreatio LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv); @@ -13732,6 +15854,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreatio return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13741,6 +15869,17 @@ void __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErr CResult_InvoiceSignOrCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint32_t orig) { LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(orig & ~1); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); @@ -13778,6 +15917,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitor LDKLockedChannelMonitor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKLockedChannelMonitor LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); @@ -13790,6 +15930,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitor return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint32_t o) { + LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)(o & ~1); + jboolean ret_val = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13812,6 +15958,7 @@ void __attribute__((visibility("default"))) TS_CVec_OutPointZ_free(uint32_tArra LDKOutPoint _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } CVec_OutPointZ_free(_res_constr); @@ -13826,6 +15973,18 @@ void __attribute__((visibility("default"))) TS_PaymentPurpose_free(uint32_t thi PaymentPurpose_free(this_ptr_conv); } +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PaymentPurpose_clone_ptr(uint32_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)arg; + int64_t ret_val = PaymentPurpose_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PaymentPurpose_clone(uint32_t orig) { LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig; LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); @@ -13866,6 +16025,18 @@ void __attribute__((visibility("default"))) TS_ClosureReason_free(uint32_t this ClosureReason_free(this_ptr_conv); } +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ClosureReason_clone_ptr(uint32_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)arg; + int64_t ret_val = ClosureReason_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ClosureReason_clone(uint32_t orig) { LDKClosureReason* orig_conv = (LDKClosureReason*)orig; LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); @@ -13934,6 +16105,15 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosureReason_write(uint3 return ret_arr; } +uint32_t __attribute__((visibility("default"))) TS_ClosureReason_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = *((uint32_t*)ser); + ser_ref.data = (int8_t*)(ser + 4); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + return (uint64_t)ret_conv; +} + void __attribute__((visibility("default"))) TS_Event_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -13943,6 +16123,18 @@ void __attribute__((visibility("default"))) TS_Event_free(uint32_t this_ptr) { Event_free(this_ptr_conv); } +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Event_clone_ptr(uint32_t arg) { + LDKEvent* arg_conv = (LDKEvent*)arg; + int64_t ret_val = Event_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Event_clone(uint32_t orig) { LDKEvent* orig_conv = (LDKEvent*)orig; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); @@ -14022,6 +16214,7 @@ uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_failed(in LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -14032,6 +16225,7 @@ uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_failed(in LDKRouteParameters retry_conv; retry_conv.inner = (void*)(retry & (~1)); retry_conv.is_owned = (retry & 1) || (retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv); retry_conv = RouteParameters_clone(&retry_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv); @@ -14117,6 +16311,15 @@ int8_tArray __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) return ret_arr; } +uint32_t __attribute__((visibility("default"))) TS_Event_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = *((uint32_t*)ser); + ser_ref.data = (int8_t*)(ser + 4); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + return (uint64_t)ret_conv; +} + void __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -14126,6 +16329,18 @@ void __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t t MessageSendEvent_free(this_ptr_conv); } +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MessageSendEvent_clone_ptr(uint32_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)arg; + int64_t ret_val = MessageSendEvent_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_clone(uint32_t orig) { LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig; LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); @@ -14141,6 +16356,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_accept LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AcceptChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); @@ -14155,6 +16371,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_open_c LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = OpenChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); @@ -14169,6 +16386,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_fundin LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingCreated_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); @@ -14183,6 +16401,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_fundin LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); @@ -14197,6 +16416,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_fundin LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingLocked_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); @@ -14211,6 +16431,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_announ LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AnnouncementSignatures_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); @@ -14225,6 +16446,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_update_htlc LDKCommitmentUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = (updates & 1) || (updates == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); updates_conv = CommitmentUpdate_clone(&updates_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); @@ -14239,6 +16461,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_revoke LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = RevokeAndACK_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); @@ -14253,6 +16476,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_closin LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ClosingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); @@ -14267,6 +16491,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_shutdo LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = Shutdown_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); @@ -14281,6 +16506,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_channe LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelReestablish_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); @@ -14292,10 +16518,12 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_c LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelAnnouncement_clone(&msg_conv); LDKChannelUpdate update_msg_conv; update_msg_conv.inner = (void*)(update_msg & (~1)); update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); update_msg_conv = ChannelUpdate_clone(&update_msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); @@ -14307,6 +16535,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_n LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = NodeAnnouncement_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); @@ -14318,6 +16547,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_c LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); @@ -14332,6 +16562,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_channe LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); @@ -14360,6 +16591,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_channe LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); @@ -14374,6 +16606,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_short_ LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); @@ -14388,6 +16621,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_reply_ LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); @@ -14431,6 +16665,18 @@ void __attribute__((visibility("default"))) TS_APIError_free(uint32_t this_ptr) APIError_free(this_ptr_conv); } +static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_APIError_clone_ptr(uint32_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)arg; + int64_t ret_val = APIError_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_APIError_clone(uint32_t orig) { LDKAPIError* orig_conv = (LDKAPIError*)orig; LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); @@ -14482,6 +16728,7 @@ uint32_t __attribute__((visibility("default"))) TS_APIError_incompatible_shutdo LDKShutdownScript script_conv; script_conv.inner = (void*)(script & (~1)); script_conv.is_owned = (script & 1) || (script == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); script_conv = ShutdownScript_clone(&script_conv); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_incompatible_shutdown_script(script_conv); @@ -14573,6 +16820,147 @@ uint32_t __attribute__((visibility("default"))) TS_Level_max() { return ret_conv; } +void __attribute__((visibility("default"))) TS_Record_free(uint32_t this_obj) { + LDKRecord this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Record_free(this_obj_conv); +} + +uint32_t __attribute__((visibility("default"))) TS_Record_get_level(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + uint32_t ret_conv = LDKLevel_to_js(Record_get_level(&this_ptr_conv)); + return ret_conv; +} + +void __attribute__((visibility("default"))) TS_Record_set_level(uint32_t this_ptr, uint32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKLevel val_conv = LDKLevel_from_js(val); + Record_set_level(&this_ptr_conv, val_conv); +} + +jstring __attribute__((visibility("default"))) TS_Record_get_args(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_args(&this_ptr_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void __attribute__((visibility("default"))) TS_Record_set_args(uint32_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_args(&this_ptr_conv, val_conv); +} + +jstring __attribute__((visibility("default"))) TS_Record_get_module_path(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&this_ptr_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void __attribute__((visibility("default"))) TS_Record_set_module_path(uint32_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_module_path(&this_ptr_conv, val_conv); +} + +jstring __attribute__((visibility("default"))) TS_Record_get_file(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_file(&this_ptr_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void __attribute__((visibility("default"))) TS_Record_set_file(uint32_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_file(&this_ptr_conv, val_conv); +} + +int32_t __attribute__((visibility("default"))) TS_Record_get_line(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_val = Record_get_line(&this_ptr_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_Record_set_line(uint32_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Record_set_line(&this_ptr_conv, val); +} + +static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Record_clone_ptr(uint32_t arg) { + LDKRecord arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Record_clone_ptr(&arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_Record_clone(uint32_t orig) { + LDKRecord orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKRecord ret_var = Record_clone(&orig_conv); + uint64_t ret_ref = 0; + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + void __attribute__((visibility("default"))) TS_Logger_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -14586,6 +16974,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_free(uint LDKChannelHandshakeConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeConfig_free(this_obj_conv); } @@ -14593,6 +16982,7 @@ int32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_get_mi LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -14601,6 +16991,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_set_minim LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } @@ -14608,6 +16999,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_get_ou LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); return ret_val; } @@ -14616,6 +17008,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_set_our_t LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); } @@ -14623,6 +17016,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_get_ou LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -14631,6 +17025,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_set_our_h LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } @@ -14639,6 +17034,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_new(i uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14646,14 +17042,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_new(i return ret_ref; } +static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_clone_ptr(uint32_t arg) { + LDKChannelHandshakeConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_clone(uint32_t orig) { LDKChannelHandshakeConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14666,6 +17085,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_defau uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14677,6 +17097,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_free(uint LDKChannelHandshakeLimits this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeLimits_free(this_obj_conv); } @@ -14684,6 +17105,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_mi LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -14692,6 +17114,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_min_f LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); } @@ -14699,6 +17122,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_ma LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -14707,6 +17131,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_max_h LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); } @@ -14714,6 +17139,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_mi LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -14722,6 +17148,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_min_m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -14729,6 +17156,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_ma LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -14737,6 +17165,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_max_c LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -14744,6 +17173,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_mi LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -14752,6 +17182,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_min_m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); } @@ -14759,6 +17190,7 @@ int32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_ma LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); return ret_val; } @@ -14767,6 +17199,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_max_m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); } @@ -14774,6 +17207,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_f LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); return ret_val; } @@ -14782,6 +17216,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_force LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); } @@ -14789,6 +17224,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_th LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); return ret_val; } @@ -14797,6 +17233,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_their LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); } @@ -14805,6 +17242,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_new(i uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14812,14 +17250,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_new(i return ret_ref; } +static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_clone_ptr(uint32_t arg) { + LDKChannelHandshakeLimits arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_clone(uint32_t orig) { LDKChannelHandshakeLimits orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14832,6 +17293,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_defau uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14843,6 +17305,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_free(uint32_t this LDKChannelConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelConfig_free(this_obj_conv); } @@ -14850,6 +17313,7 @@ int32_t __attribute__((visibility("default"))) TS_ChannelConfig_get_forwarding_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -14858,6 +17322,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_forwarding_fee LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); } @@ -14865,6 +17330,7 @@ int32_t __attribute__((visibility("default"))) TS_ChannelConfig_get_forwarding_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -14873,6 +17339,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_forwarding_fee LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } @@ -14880,6 +17347,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelConfig_get_cltv_expiry LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -14888,6 +17356,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_cltv_expiry_de LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -14895,6 +17364,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelConfig_get_announced_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_announced_channel(&this_ptr_conv); return ret_val; } @@ -14903,6 +17373,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_announced_chan LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_announced_channel(&this_ptr_conv, val); } @@ -14910,6 +17381,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelConfig_get_commit_upf LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); return ret_val; } @@ -14918,6 +17390,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_commit_upfront LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } @@ -14925,6 +17398,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelConfig_get_max_dust_ht LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); return ret_val; } @@ -14933,6 +17407,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_max_dust_htlc_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); } @@ -14940,6 +17415,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelConfig_get_force_close LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -14948,6 +17424,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_force_close_av LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); } @@ -14956,6 +17433,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t fo uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14963,14 +17441,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t fo return ret_ref; } +static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelConfig_clone_ptr(uint32_t arg) { + LDKChannelConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelConfig_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_clone(uint32_t orig) { LDKChannelConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14983,6 +17484,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_default() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14994,6 +17496,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelConfig_write(uint3 LDKChannelConfig obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15014,6 +17517,7 @@ void __attribute__((visibility("default"))) TS_UserConfig_free(uint32_t this_ob LDKUserConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UserConfig_free(this_obj_conv); } @@ -15021,10 +17525,12 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_get_own_channel_c LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15036,9 +17542,11 @@ void __attribute__((visibility("default"))) TS_UserConfig_set_own_channel_confi LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeConfig_clone(&val_conv); UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); } @@ -15047,10 +17555,12 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_get_peer_channel_ LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15062,9 +17572,11 @@ void __attribute__((visibility("default"))) TS_UserConfig_set_peer_channel_conf LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeLimits_clone(&val_conv); UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); } @@ -15073,10 +17585,12 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_get_channel_optio LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15088,9 +17602,11 @@ void __attribute__((visibility("default"))) TS_UserConfig_set_channel_options(u LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelConfig_clone(&val_conv); UserConfig_set_channel_options(&this_ptr_conv, val_conv); } @@ -15099,6 +17615,7 @@ jboolean __attribute__((visibility("default"))) TS_UserConfig_get_accept_forwar LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); return ret_val; } @@ -15107,6 +17624,7 @@ void __attribute__((visibility("default"))) TS_UserConfig_set_accept_forwards_t LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); } @@ -15114,19 +17632,23 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_ LDKChannelHandshakeConfig own_channel_config_arg_conv; own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); LDKChannelConfig channel_options_arg_conv; channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15134,14 +17656,37 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_ return ret_ref; } +static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UserConfig_clone_ptr(uint32_t arg) { + LDKUserConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UserConfig_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UserConfig_clone(uint32_t orig) { LDKUserConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUserConfig ret_var = UserConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15154,6 +17699,7 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_default() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15165,17 +17711,41 @@ void __attribute__((visibility("default"))) TS_BestBlock_free(uint32_t this_obj LDKBestBlock this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BestBlock_free(this_obj_conv); } +static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_BestBlock_clone_ptr(uint32_t arg) { + LDKBestBlock arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BestBlock_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_BestBlock_clone(uint32_t orig) { LDKBestBlock orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBestBlock ret_var = BestBlock_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15189,6 +17759,7 @@ uint32_t __attribute__((visibility("default"))) TS_BestBlock_from_genesis(uint3 uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15204,6 +17775,7 @@ uint32_t __attribute__((visibility("default"))) TS_BestBlock_new(int8_tArray bl uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15215,6 +17787,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BestBlock_block_hash(uint LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), BestBlock_block_hash(&this_arg_conv).data, 32); return ret_arr; @@ -15224,6 +17797,7 @@ int32_t __attribute__((visibility("default"))) TS_BestBlock_height(uint32_t thi LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = BestBlock_height(&this_arg_conv); return ret_val; } @@ -15309,6 +17883,7 @@ void __attribute__((visibility("default"))) TS_WatchedOutput_free(uint32_t this LDKWatchedOutput this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); WatchedOutput_free(this_obj_conv); } @@ -15316,6 +17891,7 @@ int8_tArray __attribute__((visibility("default"))) TS_WatchedOutput_get_block_h LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), WatchedOutput_get_block_hash(&this_ptr_conv).data, 32); return ret_arr; @@ -15325,6 +17901,7 @@ void __attribute__((visibility("default"))) TS_WatchedOutput_set_block_hash(uin LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -15335,10 +17912,12 @@ uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_get_outpoint(u LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15350,9 +17929,11 @@ void __attribute__((visibility("default"))) TS_WatchedOutput_set_outpoint(uint3 LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); } @@ -15361,6 +17942,7 @@ int8_tArray __attribute__((visibility("default"))) TS_WatchedOutput_get_script_ LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15371,6 +17953,7 @@ void __attribute__((visibility("default"))) TS_WatchedOutput_set_script_pubkey( LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = *((uint32_t*)val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -15385,6 +17968,7 @@ uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_new(int8_tArra LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKCVec_u8Z script_pubkey_arg_ref; script_pubkey_arg_ref.datalen = *((uint32_t*)script_pubkey_arg); @@ -15394,6 +17978,7 @@ uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_new(int8_tArra uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15401,14 +17986,37 @@ uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_new(int8_tArra return ret_ref; } +static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_WatchedOutput_clone_ptr(uint32_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = WatchedOutput_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_clone(uint32_t orig) { LDKWatchedOutput orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15420,6 +18028,7 @@ int64_t __attribute__((visibility("default"))) TS_WatchedOutput_hash(uint32_t o LDKWatchedOutput o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = WatchedOutput_hash(&o_conv); return ret_val; } @@ -15474,17 +18083,41 @@ void __attribute__((visibility("default"))) TS_MonitorUpdateId_free(uint32_t th LDKMonitorUpdateId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateId_free(this_obj_conv); } +static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MonitorUpdateId_clone_ptr(uint32_t arg) { + LDKMonitorUpdateId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateId_clone(uint32_t orig) { LDKMonitorUpdateId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15496,6 +18129,7 @@ int64_t __attribute__((visibility("default"))) TS_MonitorUpdateId_hash(uint32_t LDKMonitorUpdateId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MonitorUpdateId_hash(&o_conv); return ret_val; } @@ -15504,9 +18138,11 @@ jboolean __attribute__((visibility("default"))) TS_MonitorUpdateId_eq(uint32_t LDKMonitorUpdateId a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMonitorUpdateId b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv); return ret_val; } @@ -15524,6 +18160,7 @@ void __attribute__((visibility("default"))) TS_LockedChannelMonitor_free(uint32 LDKLockedChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockedChannelMonitor_free(this_obj_conv); } @@ -15531,6 +18168,7 @@ void __attribute__((visibility("default"))) TS_ChainMonitor_free(uint32_t this_ LDKChainMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainMonitor_free(this_obj_conv); } @@ -15558,6 +18196,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_new(uint32_t ch uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15569,6 +18208,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChainMonitor_get_claima LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ignored_channels_constr; ignored_channels_constr.datalen = *((uint32_t*)ignored_channels); if (ignored_channels_constr.datalen > 0) @@ -15581,6 +18221,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChainMonitor_get_claima LDKChannelDetails ignored_channels_conv_16_conv; ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; } @@ -15603,9 +18244,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_get_monitor(uin LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); @@ -15616,6 +18259,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChainMonitor_list_monit LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -15625,6 +18269,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChainMonitor_list_monit uint64_t ret_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner; if (ret_conv_10_var.is_owned) { ret_conv_10_ref |= 1; @@ -15640,13 +18285,16 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_channel_monitor LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorUpdateId completed_update_id_conv; completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); @@ -15657,6 +18305,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_Listen(uint3 LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -15666,6 +18315,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_Confirm(uint LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -15675,6 +18325,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_Watch(uint32 LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); return (uint64_t)ret_ret; @@ -15684,6 +18335,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_EventsProvid LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -15693,6 +18345,7 @@ void __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_free(uint32 LDKChannelMonitorUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitorUpdate_free(this_obj_conv); } @@ -15700,6 +18353,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_get_upda LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); return ret_val; } @@ -15708,17 +18362,41 @@ void __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_set_update_ LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } +static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_clone_ptr(uint32_t arg) { + LDKChannelMonitorUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_clone(uint32_t orig) { LDKChannelMonitorUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15730,6 +18408,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_writ LDKChannelMonitorUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15750,6 +18429,7 @@ void __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t LDKMonitorUpdateError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateError_free(this_obj_conv); } @@ -15757,6 +18437,7 @@ jstring __attribute__((visibility("default"))) TS_MonitorUpdateError_get_a(uint LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -15767,6 +18448,7 @@ void __attribute__((visibility("default"))) TS_MonitorUpdateError_set_a(uint32_ LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = str_ref_to_owned_c(val); MonitorUpdateError_set_a(&this_ptr_conv, val_conv); } @@ -15777,6 +18459,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_new(jstri uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15784,14 +18467,37 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_new(jstri return ret_ref; } +static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) { + LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone_ptr(uint32_t arg) { + LDKMonitorUpdateError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone(uint32_t orig) { LDKMonitorUpdateError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15808,6 +18514,18 @@ void __attribute__((visibility("default"))) TS_MonitorEvent_free(uint32_t this_ MonitorEvent_free(this_ptr_conv); } +static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MonitorEvent_clone_ptr(uint32_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; + int64_t ret_val = MonitorEvent_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_clone(uint32_t orig) { LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); @@ -15820,6 +18538,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_htlcevent(uint3 LDKHTLCUpdate a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = HTLCUpdate_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_htlcevent(a_conv); @@ -15831,6 +18550,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_commitment_tx_c LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); @@ -15842,6 +18562,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_update_complete LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); @@ -15853,6 +18574,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_update_failed(u LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_failed(a_conv); @@ -15869,21 +18591,54 @@ int8_tArray __attribute__((visibility("default"))) TS_MonitorEvent_write(uint32 return ret_arr; } +uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = *((uint32_t*)ser); + ser_ref.data = (int8_t*)(ser + 4); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + return (uint64_t)ret_conv; +} + void __attribute__((visibility("default"))) TS_HTLCUpdate_free(uint32_t this_obj) { LDKHTLCUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCUpdate_free(this_obj_conv); } +static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_HTLCUpdate_clone_ptr(uint32_t arg) { + LDKHTLCUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_HTLCUpdate_clone(uint32_t orig) { LDKHTLCUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15895,6 +18650,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HTLCUpdate_write(uint32_t LDKHTLCUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15920,6 +18676,18 @@ void __attribute__((visibility("default"))) TS_Balance_free(uint32_t this_ptr) Balance_free(this_ptr_conv); } +static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Balance_clone_ptr(uint32_t arg) { + LDKBalance* arg_conv = (LDKBalance*)arg; + int64_t ret_val = Balance_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Balance_clone(uint32_t orig) { LDKBalance* orig_conv = (LDKBalance*)orig; LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); @@ -15967,17 +18735,41 @@ void __attribute__((visibility("default"))) TS_ChannelMonitor_free(uint32_t thi LDKChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitor_free(this_obj_conv); } +static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelMonitor_clone_ptr(uint32_t arg) { + LDKChannelMonitor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_clone(uint32_t orig) { LDKChannelMonitor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15989,6 +18781,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_write(uint LDKChannelMonitor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -16000,9 +18793,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_update_monito LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMonitorUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; @@ -16021,6 +18816,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelMonitor_get_latest_upd LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ChannelMonitor_get_latest_update_id(&this_arg_conv); return ret_val; } @@ -16029,6 +18825,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_get_funding_t LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); return ((uint64_t)ret_conv); @@ -16038,6 +18835,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_outp LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -16056,6 +18854,7 @@ void __attribute__((visibility("default"))) TS_ChannelMonitor_load_outputs_to_w LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* filter_ptr = (void*)(((uint64_t)filter) & ~1); if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } LDKFilter* filter_conv = (LDKFilter*)filter_ptr; @@ -16066,6 +18865,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_and_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -16085,6 +18885,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_and_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -16104,6 +18905,7 @@ ptrArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_latest_ho LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; @@ -16127,6 +18929,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_block_co LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -16173,6 +18976,7 @@ void __attribute__((visibility("default"))) TS_ChannelMonitor_block_disconnecte LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -16193,6 +18997,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_transact LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -16239,6 +19044,7 @@ void __attribute__((visibility("default"))) TS_ChannelMonitor_transaction_uncon LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char txid_arr[32]; CHECK(*((uint32_t*)txid) == 32); memcpy(txid_arr, (uint8_t*)(txid + 4), 32); @@ -16259,6 +19065,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_best_blo LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -16290,6 +19097,7 @@ ptrArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_relevant_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); ptrArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes"); @@ -16308,10 +19116,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_current_best_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16323,6 +19133,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_clai LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -16354,6 +19165,7 @@ void __attribute__((visibility("default"))) TS_OutPoint_free(uint32_t this_obj) LDKOutPoint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OutPoint_free(this_obj_conv); } @@ -16361,6 +19173,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OutPoint_get_txid(uint32_ LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *OutPoint_get_txid(&this_ptr_conv), 32); return ret_arr; @@ -16370,6 +19183,7 @@ void __attribute__((visibility("default"))) TS_OutPoint_set_txid(uint32_t this_ LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -16380,6 +19194,7 @@ int16_t __attribute__((visibility("default"))) TS_OutPoint_get_index(uint32_t t LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OutPoint_get_index(&this_ptr_conv); return ret_val; } @@ -16388,6 +19203,7 @@ void __attribute__((visibility("default"))) TS_OutPoint_set_index(uint32_t this LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OutPoint_set_index(&this_ptr_conv, val); } @@ -16399,6 +19215,7 @@ uint32_t __attribute__((visibility("default"))) TS_OutPoint_new(int8_tArray txi uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16406,14 +19223,37 @@ uint32_t __attribute__((visibility("default"))) TS_OutPoint_new(int8_tArray txi return ret_ref; } +static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_OutPoint_clone_ptr(uint32_t arg) { + LDKOutPoint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OutPoint_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_OutPoint_clone(uint32_t orig) { LDKOutPoint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOutPoint ret_var = OutPoint_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16425,9 +19265,11 @@ jboolean __attribute__((visibility("default"))) TS_OutPoint_eq(uint32_t a, uint LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKOutPoint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = OutPoint_eq(&a_conv, &b_conv); return ret_val; } @@ -16436,6 +19278,7 @@ int64_t __attribute__((visibility("default"))) TS_OutPoint_hash(uint32_t o) { LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = OutPoint_hash(&o_conv); return ret_val; } @@ -16444,6 +19287,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OutPoint_to_channel_id(ui LDKOutPoint this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OutPoint_to_channel_id(&this_arg_conv).data, 32); return ret_arr; @@ -16453,6 +19297,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OutPoint_write(uint32_t o LDKOutPoint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -16473,6 +19318,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_f LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DelayedPaymentOutputDescriptor_free(this_obj_conv); } @@ -16480,10 +19326,12 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16495,9 +19343,11 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -16506,6 +19356,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescr LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -16515,6 +19366,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -16525,6 +19377,7 @@ int16_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescripto LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -16533,6 +19386,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } @@ -16540,6 +19394,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -16551,6 +19406,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescr LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -16560,6 +19416,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -16570,6 +19427,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescr LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; @@ -16579,6 +19437,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -16589,6 +19448,7 @@ int64_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescripto LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -16597,6 +19457,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -16604,6 +19465,7 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKPublicKey per_commitment_point_arg_ref; CHECK(*((uint32_t*)per_commitment_point_arg) == 33); @@ -16622,6 +19484,7 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16629,14 +19492,37 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript return ret_ref; } +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint32_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_clone(uint32_t orig) { LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16648,6 +19534,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescr LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -16668,6 +19555,7 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_fr LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); StaticPaymentOutputDescriptor_free(this_obj_conv); } @@ -16675,10 +19563,12 @@ uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescripto LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16690,9 +19580,11 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_se LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -16701,6 +19593,7 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_se LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -16712,6 +19605,7 @@ int8_tArray __attribute__((visibility("default"))) TS_StaticPaymentOutputDescri LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; @@ -16721,6 +19615,7 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_se LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -16731,6 +19626,7 @@ int64_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -16739,6 +19635,7 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_se LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -16746,6 +19643,7 @@ uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescripto LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); @@ -16758,6 +19656,7 @@ uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescripto uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16765,14 +19664,37 @@ uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescripto return ret_ref; } +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint32_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_clone(uint32_t orig) { LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16784,6 +19706,7 @@ int8_tArray __attribute__((visibility("default"))) TS_StaticPaymentOutputDescri LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -16809,6 +19732,18 @@ void __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_free(u SpendableOutputDescriptor_free(this_ptr_conv); } +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_clone_ptr(uint32_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; + int64_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_clone(uint32_t orig) { LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); @@ -16821,6 +19756,7 @@ uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_st LDKOutPoint outpoint_conv; outpoint_conv.inner = (void*)(outpoint & (~1)); outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); outpoint_conv = OutPoint_clone(&outpoint_conv); void* output_ptr = (void*)(((uint64_t)output) & ~1); CHECK_ACCESS(output_ptr); @@ -16836,6 +19772,7 @@ uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_de LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); @@ -16847,6 +19784,7 @@ uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_st LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); @@ -16881,6 +19819,19 @@ void __attribute__((visibility("default"))) TS_BaseSign_free(uint32_t this_ptr) BaseSign_free(this_ptr_conv); } +static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(arg); + return (uint64_t)ret_ret; +} +int64_t __attribute__((visibility("default"))) TS_Sign_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSign* arg_conv = (LDKSign*)arg_ptr; + int64_t ret_val = Sign_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Sign_clone(uint32_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -16912,6 +19863,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_free(uint32_t thi LDKInMemorySigner this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InMemorySigner_free(this_obj_conv); } @@ -16919,6 +19871,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_fundin LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_funding_key(&this_ptr_conv), 32); return ret_arr; @@ -16928,6 +19881,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_funding_key(u LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -16938,6 +19892,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_revoca LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32); return ret_arr; @@ -16947,6 +19902,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_revocation_ba LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -16957,6 +19913,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_paymen LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_payment_key(&this_ptr_conv), 32); return ret_arr; @@ -16966,6 +19923,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_payment_key(u LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -16976,6 +19934,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_delaye LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32); return ret_arr; @@ -16985,6 +19944,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_delayed_payme LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -16995,6 +19955,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_htlc_b LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32); return ret_arr; @@ -17004,6 +19965,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_htlc_base_key LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -17014,6 +19976,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_commit LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32); return ret_arr; @@ -17023,20 +19986,44 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_commitment_se LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InMemorySigner_clone_ptr(uint32_t arg) { + LDKInMemorySigner arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InMemorySigner_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_clone(uint32_t orig) { LDKInMemorySigner orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17070,6 +20057,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_new(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17081,10 +20069,12 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_counterparty_ LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17096,6 +20086,7 @@ int16_t __attribute__((visibility("default"))) TS_InMemorySigner_counterparty_s LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -17104,6 +20095,7 @@ int16_t __attribute__((visibility("default"))) TS_InMemorySigner_holder_selecte LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -17112,6 +20104,7 @@ jboolean __attribute__((visibility("default"))) TS_InMemorySigner_is_outbound(u LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InMemorySigner_is_outbound(&this_arg_conv); return ret_val; } @@ -17120,10 +20113,12 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_funding_outpo LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17135,10 +20130,12 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_get_channel_p LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17150,6 +20147,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_counterp LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = *((uint32_t*)spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -17158,6 +20156,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_counterp LDKStaticPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -17167,6 +20166,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_dynamic_ LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = *((uint32_t*)spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -17175,6 +20175,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_dynamic_ LDKDelayedPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -17184,6 +20185,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_as_BaseSign(u LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); return (uint64_t)ret_ret; @@ -17193,6 +20195,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_as_Sign(uint3 LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); return (uint64_t)ret_ret; @@ -17202,6 +20205,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_write(uint LDKInMemorySigner obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -17222,6 +20226,7 @@ void __attribute__((visibility("default"))) TS_KeysManager_free(uint32_t this_o LDKKeysManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); KeysManager_free(this_obj_conv); } @@ -17234,6 +20239,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17245,6 +20251,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_derive_channel_k LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char params_arr[32]; CHECK(*((uint32_t*)params) == 32); memcpy(params_arr, (uint8_t*)(params + 4), 32); @@ -17253,6 +20260,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_derive_channel_k uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17264,6 +20272,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_spend_spendable_ LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_SpendableOutputDescriptorZ descriptors_constr; descriptors_constr.datalen = *((uint32_t*)descriptors); if (descriptors_constr.datalen > 0) @@ -17307,6 +20316,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_as_KeysInterface LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); return (uint64_t)ret_ret; @@ -17316,6 +20326,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_free(uint32_t thi LDKChannelManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManager_free(this_obj_conv); } @@ -17323,6 +20334,7 @@ void __attribute__((visibility("default"))) TS_ChainParameters_free(uint32_t th LDKChainParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainParameters_free(this_obj_conv); } @@ -17330,6 +20342,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_get_network( LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); uint32_t ret_conv = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv)); return ret_conv; } @@ -17338,6 +20351,7 @@ void __attribute__((visibility("default"))) TS_ChainParameters_set_network(uint LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNetwork val_conv = LDKNetwork_from_js(val); ChainParameters_set_network(&this_ptr_conv, val_conv); } @@ -17346,10 +20360,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_get_best_blo LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17361,9 +20377,11 @@ void __attribute__((visibility("default"))) TS_ChainParameters_set_best_block(u LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = BestBlock_clone(&val_conv); ChainParameters_set_best_block(&this_ptr_conv, val_conv); } @@ -17373,11 +20391,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_new(uint32_t LDKBestBlock best_block_arg_conv; best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17385,14 +20405,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_new(uint32_t return ret_ref; } +static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChainParameters_clone_ptr(uint32_t arg) { + LDKChainParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChainParameters_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChainParameters_clone(uint32_t orig) { LDKChainParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17404,6 +20447,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_free( LDKCounterpartyForwardingInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyForwardingInfo_free(this_obj_conv); } @@ -17411,6 +20455,7 @@ int32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_ge LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -17419,6 +20464,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_set_f LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); } @@ -17426,6 +20472,7 @@ int32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_ge LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -17434,6 +20481,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_set_f LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); } @@ -17441,6 +20489,7 @@ int16_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_ge LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -17449,6 +20498,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_set_c LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -17457,6 +20507,7 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_n uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17464,14 +20515,37 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_n return ret_ref; } +static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_clone_ptr(uint32_t arg) { + LDKCounterpartyForwardingInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_clone(uint32_t orig) { LDKCounterpartyForwardingInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17483,6 +20557,7 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_free(uint32_ LDKChannelCounterparty this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelCounterparty_free(this_obj_conv); } @@ -17490,6 +20565,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelCounterparty_get_n LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -17499,6 +20575,7 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_set_node_id( LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -17509,10 +20586,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_get_feat LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17524,9 +20603,11 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_set_features LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); ChannelCounterparty_set_features(&this_ptr_conv, val_conv); } @@ -17535,6 +20616,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelCounterparty_get_unspe LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); return ret_val; } @@ -17543,6 +20625,7 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_set_unspenda LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } @@ -17550,11 +20633,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_get_forw LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17567,9 +20652,11 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_set_forwardi LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyForwardingInfo_clone(&val_conv); ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } @@ -17581,15 +20668,18 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_new(int8 LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKCounterpartyForwardingInfo forwarding_info_arg_conv; forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17597,14 +20687,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_new(int8 return ret_ref; } +static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelCounterparty_clone_ptr(uint32_t arg) { + LDKChannelCounterparty arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_clone(uint32_t orig) { LDKChannelCounterparty orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17616,6 +20729,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_free(uint32_t thi LDKChannelDetails this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelDetails_free(this_obj_conv); } @@ -17623,6 +20737,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelDetails_get_channe LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ChannelDetails_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -17632,6 +20747,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_channel_id(ui LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -17642,10 +20758,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_counterpa LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17657,9 +20775,11 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_counterparty( LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelCounterparty_clone(&val_conv); ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } @@ -17668,11 +20788,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_funding_t LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17685,9 +20807,11 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_funding_txo(u LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } @@ -17696,6 +20820,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_short_cha LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -17706,6 +20831,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_short_channel LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -17717,6 +20843,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_channel_va LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -17725,6 +20852,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_channel_value LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -17732,6 +20860,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_unspendab LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -17742,6 +20871,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_unspendable_p LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -17753,6 +20883,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_user_chann LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_user_channel_id(&this_ptr_conv); return ret_val; } @@ -17761,6 +20892,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_user_channel_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_user_channel_id(&this_ptr_conv, val); } @@ -17768,6 +20900,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_outbound_c LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -17776,6 +20909,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_outbound_capa LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } @@ -17783,6 +20917,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_inbound_ca LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -17791,6 +20926,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_inbound_capac LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } @@ -17798,6 +20934,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_confirmat LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -17808,6 +20945,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_confirmations LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -17819,6 +20957,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_force_clo LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -17829,6 +20968,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_force_close_s LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); @@ -17840,6 +20980,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelDetails_get_is_outbou LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_outbound(&this_ptr_conv); return ret_val; } @@ -17848,6 +20989,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_is_outbound(u LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_outbound(&this_ptr_conv, val); } @@ -17855,6 +20997,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelDetails_get_is_fundin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_funding_locked(&this_ptr_conv); return ret_val; } @@ -17863,6 +21006,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_is_funding_lo LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_funding_locked(&this_ptr_conv, val); } @@ -17870,6 +21014,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelDetails_get_is_usable LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_usable(&this_ptr_conv); return ret_val; } @@ -17878,6 +21023,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_is_usable(uin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_usable(&this_ptr_conv, val); } @@ -17885,6 +21031,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelDetails_get_is_public LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_public(&this_ptr_conv); return ret_val; } @@ -17893,6 +21040,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_is_public(uin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_public(&this_ptr_conv, val); } @@ -17903,10 +21051,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArr LDKChannelCounterparty counterparty_arg_conv; counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); LDKOutPoint funding_txo_arg_conv; funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1); CHECK_ACCESS(short_channel_id_arg_ptr); @@ -17927,6 +21077,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17934,14 +21085,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArr return ret_ref; } +static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelDetails_clone_ptr(uint32_t arg) { + LDKChannelDetails arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelDetails_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_clone(uint32_t orig) { LDKChannelDetails orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17958,6 +21132,18 @@ void __attribute__((visibility("default"))) TS_PaymentSendFailure_free(uint32_t PaymentSendFailure_free(this_ptr_conv); } +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PaymentSendFailure_clone_ptr(uint32_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; + int64_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_clone(uint32_t orig) { LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); @@ -18039,6 +21225,7 @@ uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_f LDKRouteParameters failed_paths_retry_conv; failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(*((uint32_t*)payment_id) == 32); @@ -18068,15 +21255,18 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_new(uint32_t LDKUserConfig config_conv; config_conv.inner = (void*)(config & (~1)); config_conv.is_owned = (config & 1) || (config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); config_conv = UserConfig_clone(&config_conv); LDKChainParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18088,10 +21278,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_get_current_d LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18103,12 +21295,14 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_channe LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_network_key_ref; CHECK(*((uint32_t*)their_network_key) == 33); memcpy(their_network_key_ref.compressed_form, (uint8_t*)(their_network_key + 4), 33); LDKUserConfig override_config_conv; override_config_conv.inner = (void*)(override_config & (~1)); override_config_conv.is_owned = (override_config & 1) || (override_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); override_config_conv = UserConfig_clone(&override_config_conv); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); @@ -18119,6 +21313,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelManager_list_cha LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -18128,6 +21323,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelManager_list_cha uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -18143,6 +21339,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelManager_list_usa LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -18152,6 +21349,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelManager_list_usa uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -18167,6 +21365,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_close_channel LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(*((uint32_t*)channel_id) == 32); memcpy(channel_id_arr, (uint8_t*)(channel_id + 4), 32); @@ -18180,6 +21379,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_close_channel LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(*((uint32_t*)channel_id) == 32); memcpy(channel_id_arr, (uint8_t*)(channel_id + 4), 32); @@ -18193,6 +21393,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_force_close_c LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(*((uint32_t*)channel_id) == 32); memcpy(channel_id_arr, (uint8_t*)(channel_id + 4), 32); @@ -18206,6 +21407,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_force_close_all_c LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_force_close_all_channels(&this_arg_conv); } @@ -18213,9 +21415,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_send_payment( LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32); @@ -18231,9 +21435,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_retry_payment LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(*((uint32_t*)payment_id) == 32); memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32); @@ -18246,9 +21452,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_send_spontane LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(*((uint32_t*)payment_preimage) == 32); memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32); @@ -18261,6 +21469,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_funding_trans LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char temporary_channel_id_arr[32]; CHECK(*((uint32_t*)temporary_channel_id) == 32); memcpy(temporary_channel_id_arr, (uint8_t*)(temporary_channel_id + 4), 32); @@ -18279,6 +21488,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_broadcast_node_an LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThreeBytes rgb_ref; CHECK(*((uint32_t*)rgb) == 3); memcpy(rgb_ref.data, (uint8_t*)(rgb + 4), 3); @@ -18306,6 +21516,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_process_pending_h LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } @@ -18313,6 +21524,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_timer_tick_occurr LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_timer_tick_occurred(&this_arg_conv); } @@ -18320,6 +21532,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelManager_fail_htlc_bac LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_arr, (uint8_t*)(payment_hash + 4), 32); @@ -18332,6 +21545,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelManager_claim_funds(u LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(*((uint32_t*)payment_preimage) == 32); memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32); @@ -18343,6 +21557,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelManager_get_our_no LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); return ret_arr; @@ -18352,6 +21567,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inboun LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); @@ -18365,6 +21581,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inboun LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32); @@ -18381,6 +21598,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_MessageSen LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -18390,6 +21608,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_EventsProv LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -18399,6 +21618,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Listen(uin LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChannelManager_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -18408,6 +21628,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Confirm(ui LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -18417,6 +21638,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelManager_await_persist LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); return ret_val; } @@ -18425,6 +21647,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_await_persistable LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_await_persistable_update(&this_arg_conv); } @@ -18432,10 +21655,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_current_best_ LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18447,6 +21672,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_ChannelMes LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -18456,6 +21682,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelManager_write(uint LDKChannelManager obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -18467,6 +21694,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_free(uint LDKChannelManagerReadArgs this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManagerReadArgs_free(this_obj_conv); } @@ -18474,6 +21702,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_k LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; return ret_ret; @@ -18483,6 +21712,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_keys_ LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); @@ -18493,6 +21723,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_f LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; return ret_ret; @@ -18502,6 +21733,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_fee_e LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); @@ -18512,6 +21744,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_c LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; return ret_ret; @@ -18521,6 +21754,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_chain LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKWatch val_conv = *(LDKWatch*)(val_ptr); @@ -18531,6 +21765,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_t LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; return ret_ret; @@ -18540,6 +21775,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_tx_br LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); @@ -18550,6 +21786,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_l LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; return ret_ret; @@ -18559,6 +21796,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_logge LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKLogger val_conv = *(LDKLogger*)(val_ptr); @@ -18569,10 +21807,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_d LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18584,9 +21824,11 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_defau LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UserConfig_clone(&val_conv); ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } @@ -18610,6 +21852,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_new(u LDKUserConfig default_config_conv; default_config_conv.inner = (void*)(default_config & (~1)); default_config_conv.is_owned = (default_config & 1) || (default_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); default_config_conv = UserConfig_clone(&default_config_conv); LDKCVec_ChannelMonitorZ channel_monitors_constr; channel_monitors_constr.datalen = *((uint32_t*)channel_monitors); @@ -18623,12 +21866,14 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_new(u LDKChannelMonitor channel_monitors_conv_16_conv; channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18643,6 +21888,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMana LDKChannelManagerReadArgs arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = (arg & 1) || (arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); // Warning: we need a move here but no clone is available for LDKChannelManagerReadArgs LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); @@ -18653,17 +21899,41 @@ void __attribute__((visibility("default"))) TS_DecodeError_free(uint32_t this_o LDKDecodeError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DecodeError_free(this_obj_conv); } +static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { + LDKDecodeError ret_var = DecodeError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_DecodeError_clone_ptr(uint32_t arg) { + LDKDecodeError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DecodeError_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_DecodeError_clone(uint32_t orig) { LDKDecodeError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDecodeError ret_var = DecodeError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18675,6 +21945,7 @@ void __attribute__((visibility("default"))) TS_Init_free(uint32_t this_obj) { LDKInit this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Init_free(this_obj_conv); } @@ -18682,10 +21953,12 @@ uint32_t __attribute__((visibility("default"))) TS_Init_get_features(uint32_t t LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18697,9 +21970,11 @@ void __attribute__((visibility("default"))) TS_Init_set_features(uint32_t this_ LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); Init_set_features(&this_ptr_conv, val_conv); } @@ -18708,11 +21983,13 @@ uint32_t __attribute__((visibility("default"))) TS_Init_new(uint32_t features_a LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKInit ret_var = Init_new(features_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18720,14 +21997,37 @@ uint32_t __attribute__((visibility("default"))) TS_Init_new(uint32_t features_a return ret_ref; } +static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { + LDKInit ret_var = Init_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Init_clone_ptr(uint32_t arg) { + LDKInit arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Init_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Init_clone(uint32_t orig) { LDKInit orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInit ret_var = Init_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18739,6 +22039,7 @@ void __attribute__((visibility("default"))) TS_ErrorMessage_free(uint32_t this_ LDKErrorMessage this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErrorMessage_free(this_obj_conv); } @@ -18746,6 +22047,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ErrorMessage_get_channel_ LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ErrorMessage_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -18755,6 +22057,7 @@ void __attribute__((visibility("default"))) TS_ErrorMessage_set_channel_id(uint LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -18765,6 +22068,7 @@ jstring __attribute__((visibility("default"))) TS_ErrorMessage_get_data(uint32_ LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -18775,6 +22079,7 @@ void __attribute__((visibility("default"))) TS_ErrorMessage_set_data(uint32_t t LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = str_ref_to_owned_c(val); ErrorMessage_set_data(&this_ptr_conv, val_conv); } @@ -18788,6 +22093,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorMessage_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18795,14 +22101,37 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorMessage_new(int8_tArray return ret_ref; } +static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ErrorMessage_clone_ptr(uint32_t arg) { + LDKErrorMessage arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ErrorMessage_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ErrorMessage_clone(uint32_t orig) { LDKErrorMessage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18814,6 +22143,7 @@ void __attribute__((visibility("default"))) TS_Ping_free(uint32_t this_obj) { LDKPing this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Ping_free(this_obj_conv); } @@ -18821,6 +22151,7 @@ int16_t __attribute__((visibility("default"))) TS_Ping_get_ponglen(uint32_t thi LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_ponglen(&this_ptr_conv); return ret_val; } @@ -18829,6 +22160,7 @@ void __attribute__((visibility("default"))) TS_Ping_set_ponglen(uint32_t this_p LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_ponglen(&this_ptr_conv, val); } @@ -18836,6 +22168,7 @@ int16_t __attribute__((visibility("default"))) TS_Ping_get_byteslen(uint32_t th LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_byteslen(&this_ptr_conv); return ret_val; } @@ -18844,6 +22177,7 @@ void __attribute__((visibility("default"))) TS_Ping_set_byteslen(uint32_t this_ LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_byteslen(&this_ptr_conv, val); } @@ -18852,6 +22186,7 @@ uint32_t __attribute__((visibility("default"))) TS_Ping_new(int16_t ponglen_arg uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18859,14 +22194,37 @@ uint32_t __attribute__((visibility("default"))) TS_Ping_new(int16_t ponglen_arg return ret_ref; } +static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Ping_clone_ptr(uint32_t arg) { + LDKPing arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Ping_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Ping_clone(uint32_t orig) { LDKPing orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPing ret_var = Ping_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18878,6 +22236,7 @@ void __attribute__((visibility("default"))) TS_Pong_free(uint32_t this_obj) { LDKPong this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Pong_free(this_obj_conv); } @@ -18885,6 +22244,7 @@ int16_t __attribute__((visibility("default"))) TS_Pong_get_byteslen(uint32_t th LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Pong_get_byteslen(&this_ptr_conv); return ret_val; } @@ -18893,6 +22253,7 @@ void __attribute__((visibility("default"))) TS_Pong_set_byteslen(uint32_t this_ LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Pong_set_byteslen(&this_ptr_conv, val); } @@ -18901,6 +22262,7 @@ uint32_t __attribute__((visibility("default"))) TS_Pong_new(int16_t byteslen_ar uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18908,14 +22270,37 @@ uint32_t __attribute__((visibility("default"))) TS_Pong_new(int16_t byteslen_ar return ret_ref; } +static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Pong_clone_ptr(uint32_t arg) { + LDKPong arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Pong_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Pong_clone(uint32_t orig) { LDKPong orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPong ret_var = Pong_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18927,6 +22312,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_free(uint32_t this_o LDKOpenChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OpenChannel_free(this_obj_conv); } @@ -18934,6 +22320,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_chain_has LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *OpenChannel_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -18943,6 +22330,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_chain_hash(uint3 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -18953,6 +22341,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_temporary LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -18962,6 +22351,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_temporary_channe LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -18972,6 +22362,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_funding_satos LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -18980,6 +22371,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_funding_satoshis LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_funding_satoshis(&this_ptr_conv, val); } @@ -18987,6 +22379,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_push_msat(uin LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_push_msat(&this_ptr_conv); return ret_val; } @@ -18995,6 +22388,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_push_msat(uint32 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_push_msat(&this_ptr_conv, val); } @@ -19002,6 +22396,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_dust_limit_sa LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -19010,6 +22405,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_dust_limit_satos LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -19017,6 +22413,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_max_htlc_valu LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -19025,6 +22422,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_max_htlc_value_i LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -19032,6 +22430,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_channel_reser LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -19040,6 +22439,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_channel_reserve_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -19047,6 +22447,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_htlc_minimum_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -19055,6 +22456,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_htlc_minimum_msa LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -19062,6 +22464,7 @@ int32_t __attribute__((visibility("default"))) TS_OpenChannel_get_feerate_per_k LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = OpenChannel_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -19070,6 +22473,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_feerate_per_kw(u LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } @@ -19077,6 +22481,7 @@ int16_t __attribute__((visibility("default"))) TS_OpenChannel_get_to_self_delay LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -19085,6 +22490,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_to_self_delay(ui LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -19092,6 +22498,7 @@ int16_t __attribute__((visibility("default"))) TS_OpenChannel_get_max_accepted_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -19100,6 +22507,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_max_accepted_htl LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -19107,6 +22515,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_funding_p LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19116,6 +22525,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_funding_pubkey(u LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19126,6 +22536,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_revocatio LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19135,6 +22546,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_revocation_basep LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19145,6 +22557,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_payment_p LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19154,6 +22567,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_payment_point(ui LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19164,6 +22578,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_delayed_p LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19173,6 +22588,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_delayed_payment_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19183,6 +22599,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_htlc_base LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19192,6 +22609,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_htlc_basepoint(u LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19202,6 +22620,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_first_per LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19211,6 +22630,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_first_per_commit LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19221,6 +22641,7 @@ int8_t __attribute__((visibility("default"))) TS_OpenChannel_get_channel_flags( LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = OpenChannel_get_channel_flags(&this_ptr_conv); return ret_val; } @@ -19229,17 +22650,41 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_channel_flags(ui LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_flags(&this_ptr_conv, val); } +static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_OpenChannel_clone_ptr(uint32_t arg) { + LDKOpenChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OpenChannel_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_OpenChannel_clone(uint32_t orig) { LDKOpenChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19251,6 +22696,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_free(uint32_t this LDKAcceptChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AcceptChannel_free(this_obj_conv); } @@ -19258,6 +22704,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_tempora LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19267,6 +22714,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_temporary_chan LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19277,6 +22725,7 @@ int64_t __attribute__((visibility("default"))) TS_AcceptChannel_get_dust_limit_ LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -19285,6 +22734,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_dust_limit_sat LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -19292,6 +22742,7 @@ int64_t __attribute__((visibility("default"))) TS_AcceptChannel_get_max_htlc_va LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -19300,6 +22751,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_max_htlc_value LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -19307,6 +22759,7 @@ int64_t __attribute__((visibility("default"))) TS_AcceptChannel_get_channel_res LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -19315,6 +22768,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_channel_reserv LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -19322,6 +22776,7 @@ int64_t __attribute__((visibility("default"))) TS_AcceptChannel_get_htlc_minimu LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -19330,6 +22785,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_htlc_minimum_m LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -19337,6 +22793,7 @@ int32_t __attribute__((visibility("default"))) TS_AcceptChannel_get_minimum_dep LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = AcceptChannel_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -19345,6 +22802,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_minimum_depth( LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } @@ -19352,6 +22810,7 @@ int16_t __attribute__((visibility("default"))) TS_AcceptChannel_get_to_self_del LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -19360,6 +22819,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_to_self_delay( LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -19367,6 +22827,7 @@ int16_t __attribute__((visibility("default"))) TS_AcceptChannel_get_max_accepte LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -19375,6 +22836,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_max_accepted_h LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -19382,6 +22844,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_funding LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19391,6 +22854,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_funding_pubkey LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19401,6 +22865,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_revocat LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19410,6 +22875,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_revocation_bas LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19420,6 +22886,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_payment LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19429,6 +22896,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_payment_point( LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19439,6 +22907,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_delayed LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19448,6 +22917,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_delayed_paymen LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19458,6 +22928,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_htlc_ba LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19467,6 +22938,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_htlc_basepoint LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19477,6 +22949,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_first_p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19486,20 +22959,44 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_first_per_comm LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } +static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { + LDKAcceptChannel ret_var = AcceptChannel_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_AcceptChannel_clone_ptr(uint32_t arg) { + LDKAcceptChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AcceptChannel_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_AcceptChannel_clone(uint32_t orig) { LDKAcceptChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19511,6 +23008,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_free(uint32_t thi LDKFundingCreated this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingCreated_free(this_obj_conv); } @@ -19518,6 +23016,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_get_tempor LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19527,6 +23026,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_set_temporary_cha LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19537,6 +23037,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_get_fundin LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *FundingCreated_get_funding_txid(&this_ptr_conv), 32); return ret_arr; @@ -19546,6 +23047,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_set_funding_txid( LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19556,6 +23058,7 @@ int16_t __attribute__((visibility("default"))) TS_FundingCreated_get_funding_ou LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); return ret_val; } @@ -19564,6 +23067,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_set_funding_outpu LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); FundingCreated_set_funding_output_index(&this_ptr_conv, val); } @@ -19571,6 +23075,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_get_signat LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), FundingCreated_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -19580,6 +23085,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_set_signature(uin LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -19600,6 +23106,7 @@ uint32_t __attribute__((visibility("default"))) TS_FundingCreated_new(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19607,14 +23114,37 @@ uint32_t __attribute__((visibility("default"))) TS_FundingCreated_new(int8_tArr return ret_ref; } +static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { + LDKFundingCreated ret_var = FundingCreated_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_FundingCreated_clone_ptr(uint32_t arg) { + LDKFundingCreated arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingCreated_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_FundingCreated_clone(uint32_t orig) { LDKFundingCreated orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19626,6 +23156,7 @@ void __attribute__((visibility("default"))) TS_FundingSigned_free(uint32_t this LDKFundingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingSigned_free(this_obj_conv); } @@ -19633,6 +23164,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingSigned_get_channel LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *FundingSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19642,6 +23174,7 @@ void __attribute__((visibility("default"))) TS_FundingSigned_set_channel_id(uin LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19652,6 +23185,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingSigned_get_signatu LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), FundingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -19661,6 +23195,7 @@ void __attribute__((visibility("default"))) TS_FundingSigned_set_signature(uint LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -19678,6 +23213,7 @@ uint32_t __attribute__((visibility("default"))) TS_FundingSigned_new(int8_tArra uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19685,14 +23221,37 @@ uint32_t __attribute__((visibility("default"))) TS_FundingSigned_new(int8_tArra return ret_ref; } +static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { + LDKFundingSigned ret_var = FundingSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_FundingSigned_clone_ptr(uint32_t arg) { + LDKFundingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingSigned_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_FundingSigned_clone(uint32_t orig) { LDKFundingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19704,6 +23263,7 @@ void __attribute__((visibility("default"))) TS_FundingLocked_free(uint32_t this LDKFundingLocked this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingLocked_free(this_obj_conv); } @@ -19711,6 +23271,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingLocked_get_channel LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *FundingLocked_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19720,6 +23281,7 @@ void __attribute__((visibility("default"))) TS_FundingLocked_set_channel_id(uin LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19730,6 +23292,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingLocked_get_next_pe LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19739,6 +23302,7 @@ void __attribute__((visibility("default"))) TS_FundingLocked_set_next_per_commi LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19756,6 +23320,7 @@ uint32_t __attribute__((visibility("default"))) TS_FundingLocked_new(int8_tArra uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19763,14 +23328,37 @@ uint32_t __attribute__((visibility("default"))) TS_FundingLocked_new(int8_tArra return ret_ref; } +static inline uint64_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { + LDKFundingLocked ret_var = FundingLocked_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_FundingLocked_clone_ptr(uint32_t arg) { + LDKFundingLocked arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingLocked_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_FundingLocked_clone(uint32_t orig) { LDKFundingLocked orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19782,6 +23370,7 @@ void __attribute__((visibility("default"))) TS_Shutdown_free(uint32_t this_obj) LDKShutdown this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Shutdown_free(this_obj_conv); } @@ -19789,6 +23378,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Shutdown_get_channel_id(u LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *Shutdown_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19798,6 +23388,7 @@ void __attribute__((visibility("default"))) TS_Shutdown_set_channel_id(uint32_t LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19808,6 +23399,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Shutdown_get_scriptpubkey LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -19818,6 +23410,7 @@ void __attribute__((visibility("default"))) TS_Shutdown_set_scriptpubkey(uint32 LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = *((uint32_t*)val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -19837,6 +23430,7 @@ uint32_t __attribute__((visibility("default"))) TS_Shutdown_new(int8_tArray cha uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19844,14 +23438,37 @@ uint32_t __attribute__((visibility("default"))) TS_Shutdown_new(int8_tArray cha return ret_ref; } +static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { + LDKShutdown ret_var = Shutdown_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Shutdown_clone_ptr(uint32_t arg) { + LDKShutdown arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Shutdown_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Shutdown_clone(uint32_t orig) { LDKShutdown orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdown ret_var = Shutdown_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19863,6 +23480,7 @@ void __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_free(uint3 LDKClosingSignedFeeRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSignedFeeRange_free(this_obj_conv); } @@ -19870,6 +23488,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_get_min LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -19878,6 +23497,7 @@ void __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_set_min_fe LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); } @@ -19885,6 +23505,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_get_max LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -19893,6 +23514,7 @@ void __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_set_max_fe LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); } @@ -19901,6 +23523,7 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_new(in uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19908,14 +23531,37 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_new(in return ret_ref; } +static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_clone_ptr(uint32_t arg) { + LDKClosingSignedFeeRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_clone(uint32_t orig) { LDKClosingSignedFeeRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19927,6 +23573,7 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_free(uint32_t this LDKClosingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSigned_free(this_obj_conv); } @@ -19934,6 +23581,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingSigned_get_channel LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ClosingSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19943,6 +23591,7 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_set_channel_id(uin LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19953,6 +23602,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingSigned_get_fee_satoshi LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSigned_get_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -19961,6 +23611,7 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_set_fee_satoshis(u LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); } @@ -19968,6 +23619,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingSigned_get_signatu LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -19977,6 +23629,7 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_set_signature(uint LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -19987,11 +23640,13 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_get_fee_range( LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20004,9 +23659,11 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_set_fee_range(uint LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ClosingSignedFeeRange_clone(&val_conv); ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } @@ -20021,11 +23678,13 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_new(int8_tArra LDKClosingSignedFeeRange fee_range_arg_conv; fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20033,14 +23692,37 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_new(int8_tArra return ret_ref; } +static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { + LDKClosingSigned ret_var = ClosingSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ClosingSigned_clone_ptr(uint32_t arg) { + LDKClosingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSigned_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_clone(uint32_t orig) { LDKClosingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20052,6 +23734,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_free(uint32_t this LDKUpdateAddHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateAddHTLC_free(this_obj_conv); } @@ -20059,6 +23742,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_channel LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20068,6 +23752,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_channel_id(uin LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20078,6 +23763,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_htlc_id(uin LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -20086,6 +23772,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_htlc_id(uint32 LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -20093,6 +23780,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_amount_msat LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -20101,6 +23789,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_amount_msat(ui LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); } @@ -20108,6 +23797,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_payment LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32); return ret_arr; @@ -20117,6 +23807,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_payment_hash(u LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20127,6 +23818,7 @@ int32_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_cltv_expiry LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -20135,17 +23827,41 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_cltv_expiry(ui LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); } +static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_clone_ptr(uint32_t arg) { + LDKUpdateAddHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_clone(uint32_t orig) { LDKUpdateAddHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20157,6 +23873,7 @@ void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_free(uint32_t LDKUpdateFulfillHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFulfillHTLC_free(this_obj_conv); } @@ -20164,6 +23881,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_get_cha LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20173,6 +23891,7 @@ void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_set_channel_id LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20183,6 +23902,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_get_htlc_id LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -20191,6 +23911,7 @@ void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_set_htlc_id(ui LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -20198,6 +23919,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_get_pay LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32); return ret_arr; @@ -20207,6 +23929,7 @@ void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_set_payment_pr LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20224,6 +23947,7 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_new(int8_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20231,14 +23955,37 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_new(int8_t return ret_ref; } +static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_clone_ptr(uint32_t arg) { + LDKUpdateFulfillHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_clone(uint32_t orig) { LDKUpdateFulfillHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20250,6 +23997,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailHTLC_free(uint32_t thi LDKUpdateFailHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailHTLC_free(this_obj_conv); } @@ -20257,6 +24005,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFailHTLC_get_channe LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20266,6 +24015,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailHTLC_set_channel_id(ui LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20276,6 +24026,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateFailHTLC_get_htlc_id(ui LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -20284,17 +24035,41 @@ void __attribute__((visibility("default"))) TS_UpdateFailHTLC_set_htlc_id(uint3 LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); } +static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateFailHTLC_clone_ptr(uint32_t arg) { + LDKUpdateFailHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateFailHTLC_clone(uint32_t orig) { LDKUpdateFailHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20306,6 +24081,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_free(uin LDKUpdateFailMalformedHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailMalformedHTLC_free(this_obj_conv); } @@ -20313,6 +24089,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_g LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20322,6 +24099,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_set_chan LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20332,6 +24110,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_get_h LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -20340,6 +24119,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_set_htlc LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -20347,6 +24127,7 @@ int16_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_get_f LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); return ret_val; } @@ -20355,17 +24136,41 @@ void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_set_fail LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); } +static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint32_t arg) { + LDKUpdateFailMalformedHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_clone(uint32_t orig) { LDKUpdateFailMalformedHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20377,6 +24182,7 @@ void __attribute__((visibility("default"))) TS_CommitmentSigned_free(uint32_t t LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentSigned_free(this_obj_conv); } @@ -20384,6 +24190,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CommitmentSigned_get_chan LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *CommitmentSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20393,6 +24200,7 @@ void __attribute__((visibility("default"))) TS_CommitmentSigned_set_channel_id( LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20403,6 +24211,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CommitmentSigned_get_sign LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -20412,6 +24221,7 @@ void __attribute__((visibility("default"))) TS_CommitmentSigned_set_signature(u LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -20422,6 +24232,7 @@ void __attribute__((visibility("default"))) TS_CommitmentSigned_set_htlc_signat LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -20464,6 +24275,7 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentSigned_new(int8_tA uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20471,14 +24283,37 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentSigned_new(int8_tA return ret_ref; } +static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { + LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CommitmentSigned_clone_ptr(uint32_t arg) { + LDKCommitmentSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CommitmentSigned_clone(uint32_t orig) { LDKCommitmentSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20490,6 +24325,7 @@ void __attribute__((visibility("default"))) TS_RevokeAndACK_free(uint32_t this_ LDKRevokeAndACK this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RevokeAndACK_free(this_obj_conv); } @@ -20497,6 +24333,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_get_channel_ LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *RevokeAndACK_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20506,6 +24343,7 @@ void __attribute__((visibility("default"))) TS_RevokeAndACK_set_channel_id(uint LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20516,6 +24354,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_get_per_comm LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32); return ret_arr; @@ -20525,6 +24364,7 @@ void __attribute__((visibility("default"))) TS_RevokeAndACK_set_per_commitment_ LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20535,6 +24375,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_get_next_per LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -20544,6 +24385,7 @@ void __attribute__((visibility("default"))) TS_RevokeAndACK_set_next_per_commit LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -20564,6 +24406,7 @@ uint32_t __attribute__((visibility("default"))) TS_RevokeAndACK_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20571,14 +24414,37 @@ uint32_t __attribute__((visibility("default"))) TS_RevokeAndACK_new(int8_tArray return ret_ref; } +static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { + LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RevokeAndACK_clone_ptr(uint32_t arg) { + LDKRevokeAndACK arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RevokeAndACK_clone(uint32_t orig) { LDKRevokeAndACK orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20590,6 +24456,7 @@ void __attribute__((visibility("default"))) TS_UpdateFee_free(uint32_t this_obj LDKUpdateFee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFee_free(this_obj_conv); } @@ -20597,6 +24464,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFee_get_channel_id( LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFee_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20606,6 +24474,7 @@ void __attribute__((visibility("default"))) TS_UpdateFee_set_channel_id(uint32_ LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20616,6 +24485,7 @@ int32_t __attribute__((visibility("default"))) TS_UpdateFee_get_feerate_per_kw( LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateFee_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -20624,6 +24494,7 @@ void __attribute__((visibility("default"))) TS_UpdateFee_set_feerate_per_kw(uin LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } @@ -20635,6 +24506,7 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFee_new(int8_tArray ch uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20642,14 +24514,37 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFee_new(int8_tArray ch return ret_ref; } +static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { + LDKUpdateFee ret_var = UpdateFee_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateFee_clone_ptr(uint32_t arg) { + LDKUpdateFee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFee_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateFee_clone(uint32_t orig) { LDKUpdateFee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20661,6 +24556,7 @@ void __attribute__((visibility("default"))) TS_DataLossProtect_free(uint32_t th LDKDataLossProtect this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DataLossProtect_free(this_obj_conv); } @@ -20668,6 +24564,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DataLossProtect_get_your_ LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32); return ret_arr; @@ -20677,6 +24574,7 @@ void __attribute__((visibility("default"))) TS_DataLossProtect_set_your_last_pe LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20687,6 +24585,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DataLossProtect_get_my_cu LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -20696,6 +24595,7 @@ void __attribute__((visibility("default"))) TS_DataLossProtect_set_my_current_p LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -20713,6 +24613,7 @@ uint32_t __attribute__((visibility("default"))) TS_DataLossProtect_new(int8_tAr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20720,14 +24621,37 @@ uint32_t __attribute__((visibility("default"))) TS_DataLossProtect_new(int8_tAr return ret_ref; } +static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { + LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_DataLossProtect_clone_ptr(uint32_t arg) { + LDKDataLossProtect arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DataLossProtect_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_DataLossProtect_clone(uint32_t orig) { LDKDataLossProtect orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20739,6 +24663,7 @@ void __attribute__((visibility("default"))) TS_ChannelReestablish_free(uint32_t LDKChannelReestablish this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelReestablish_free(this_obj_conv); } @@ -20746,6 +24671,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelReestablish_get_ch LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ChannelReestablish_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20755,6 +24681,7 @@ void __attribute__((visibility("default"))) TS_ChannelReestablish_set_channel_i LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20765,6 +24692,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelReestablish_get_next_l LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); return ret_val; } @@ -20773,6 +24701,7 @@ void __attribute__((visibility("default"))) TS_ChannelReestablish_set_next_loca LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); } @@ -20780,6 +24709,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelReestablish_get_next_r LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); return ret_val; } @@ -20788,17 +24718,41 @@ void __attribute__((visibility("default"))) TS_ChannelReestablish_set_next_remo LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); } +static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { + LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelReestablish_clone_ptr(uint32_t arg) { + LDKChannelReestablish arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelReestablish_clone(uint32_t orig) { LDKChannelReestablish orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20810,6 +24764,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_free(uint LDKAnnouncementSignatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AnnouncementSignatures_free(this_obj_conv); } @@ -20817,6 +24772,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_ge LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20826,6 +24782,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_chann LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20836,6 +24793,7 @@ int64_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_get_sh LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -20844,6 +24802,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_short LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); } @@ -20851,6 +24810,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_ge LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -20860,6 +24820,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_node_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -20870,6 +24831,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_ge LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -20879,6 +24841,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_bitco LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -20899,6 +24862,7 @@ uint32_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_new(i uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20906,14 +24870,37 @@ uint32_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_new(i return ret_ref; } +static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_clone_ptr(uint32_t arg) { + LDKAnnouncementSignatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_clone(uint32_t orig) { LDKAnnouncementSignatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20930,6 +24917,18 @@ void __attribute__((visibility("default"))) TS_NetAddress_free(uint32_t this_pt NetAddress_free(this_ptr_conv); } +static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NetAddress_clone_ptr(uint32_t arg) { + LDKNetAddress* arg_conv = (LDKNetAddress*)arg; + int64_t ret_val = NetAddress_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NetAddress_clone(uint32_t orig) { LDKNetAddress* orig_conv = (LDKNetAddress*)orig; LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); @@ -21000,6 +24999,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_free(ui LDKUnsignedNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedNodeAnnouncement_free(this_obj_conv); } @@ -21007,10 +25007,12 @@ uint32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_get LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21022,9 +25024,11 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_fea LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -21033,6 +25037,7 @@ int32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_get_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); return ret_val; } @@ -21041,6 +25046,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_tim LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); } @@ -21048,6 +25054,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21057,6 +25064,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_nod LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -21067,6 +25075,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(3, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3); return ret_arr; @@ -21076,6 +25085,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_rgb LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK(*((uint32_t*)val) == 3); memcpy(val_ref.data, (uint8_t*)(val + 4), 3); @@ -21086,6 +25096,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32); return ret_arr; @@ -21095,6 +25106,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_ali LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21105,6 +25117,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_add LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -21123,14 +25136,37 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_add UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint32_t arg) { + LDKUnsignedNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_clone(uint32_t orig) { LDKUnsignedNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21142,6 +25178,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncement_free(uint32_t t LDKNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncement_free(this_obj_conv); } @@ -21149,6 +25186,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncement_get_sign LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21158,6 +25196,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncement_set_signature(u LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21168,10 +25207,12 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_get_content LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21183,9 +25224,11 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncement_set_contents(ui LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedNodeAnnouncement_clone(&val_conv); NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -21197,11 +25240,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_new(int8_tA LDKUnsignedNodeAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21209,14 +25254,37 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_new(int8_tA return ret_ref; } +static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeAnnouncement_clone_ptr(uint32_t arg) { + LDKNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_clone(uint32_t orig) { LDKNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21228,6 +25296,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_free LDKUnsignedChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelAnnouncement_free(this_obj_conv); } @@ -21235,10 +25304,12 @@ uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21250,9 +25321,11 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -21261,6 +25334,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -21270,6 +25344,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21280,6 +25355,7 @@ int64_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_g LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -21288,6 +25364,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); } @@ -21295,6 +25372,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21304,6 +25382,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -21314,6 +25393,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21323,6 +25403,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -21333,6 +25414,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21342,6 +25424,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -21352,6 +25435,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21361,20 +25445,44 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } +static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint32_t arg) { + LDKUnsignedChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_clone(uint32_t orig) { LDKUnsignedChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21386,6 +25494,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_free(uint32_ LDKChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelAnnouncement_free(this_obj_conv); } @@ -21393,6 +25502,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_n LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21402,6 +25512,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_node_sig LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21412,6 +25523,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_n LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21421,6 +25533,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_node_sig LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21431,6 +25544,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_b LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21440,6 +25554,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_bitcoin_ LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21450,6 +25565,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_b LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21459,6 +25575,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_bitcoin_ LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21469,10 +25586,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_cont LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21484,9 +25603,11 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_contents LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelAnnouncement_clone(&val_conv); ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -21507,11 +25628,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_new(int8 LDKUnsignedChannelAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21519,14 +25642,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_new(int8 return ret_ref; } +static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_clone_ptr(uint32_t arg) { + LDKChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_clone(uint32_t orig) { LDKChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21538,6 +25684,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_free(uint3 LDKUnsignedChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelUpdate_free(this_obj_conv); } @@ -21545,6 +25692,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -21554,6 +25702,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_chain_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21564,6 +25713,7 @@ int64_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_sho LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -21572,6 +25722,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_short_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); } @@ -21579,6 +25730,7 @@ int32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_tim LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); return ret_val; } @@ -21587,6 +25739,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_timest LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } @@ -21594,6 +25747,7 @@ int8_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_flag LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = UnsignedChannelUpdate_get_flags(&this_ptr_conv); return ret_val; } @@ -21602,6 +25756,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_flags( LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } @@ -21609,6 +25764,7 @@ int16_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_clt LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -21617,6 +25773,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_cltv_e LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -21624,6 +25781,7 @@ int64_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_htl LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -21632,6 +25790,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_htlc_m LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -21639,6 +25798,7 @@ int32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_fee LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -21647,6 +25807,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_fee_ba LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); } @@ -21654,6 +25815,7 @@ int32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_fee LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -21662,17 +25824,41 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_fee_pr LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); } +static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_clone_ptr(uint32_t arg) { + LDKUnsignedChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_clone(uint32_t orig) { LDKUnsignedChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21684,6 +25870,7 @@ void __attribute__((visibility("default"))) TS_ChannelUpdate_free(uint32_t this LDKChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelUpdate_free(this_obj_conv); } @@ -21691,6 +25878,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelUpdate_get_signatu LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21700,6 +25888,7 @@ void __attribute__((visibility("default"))) TS_ChannelUpdate_set_signature(uint LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21710,10 +25899,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_get_contents(u LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21725,9 +25916,11 @@ void __attribute__((visibility("default"))) TS_ChannelUpdate_set_contents(uint3 LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelUpdate_clone(&val_conv); ChannelUpdate_set_contents(&this_ptr_conv, val_conv); } @@ -21739,11 +25932,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_new(int8_tArra LDKUnsignedChannelUpdate contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21751,14 +25946,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_new(int8_tArra return ret_ref; } +static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { + LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelUpdate_clone_ptr(uint32_t arg) { + LDKChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_clone(uint32_t orig) { LDKChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21770,6 +25988,7 @@ void __attribute__((visibility("default"))) TS_QueryChannelRange_free(uint32_t LDKQueryChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryChannelRange_free(this_obj_conv); } @@ -21777,6 +25996,7 @@ int8_tArray __attribute__((visibility("default"))) TS_QueryChannelRange_get_cha LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -21786,6 +26006,7 @@ void __attribute__((visibility("default"))) TS_QueryChannelRange_set_chain_hash LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21796,6 +26017,7 @@ int32_t __attribute__((visibility("default"))) TS_QueryChannelRange_get_first_b LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -21804,6 +26026,7 @@ void __attribute__((visibility("default"))) TS_QueryChannelRange_set_first_bloc LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -21811,6 +26034,7 @@ int32_t __attribute__((visibility("default"))) TS_QueryChannelRange_get_number_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -21819,6 +26043,7 @@ void __attribute__((visibility("default"))) TS_QueryChannelRange_set_number_of_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -21830,6 +26055,7 @@ uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_new(int8_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21837,14 +26063,37 @@ uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_new(int8_t return ret_ref; } +static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { + LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_QueryChannelRange_clone_ptr(uint32_t arg) { + LDKQueryChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_clone(uint32_t orig) { LDKQueryChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21856,6 +26105,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_free(uint32_t LDKReplyChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyChannelRange_free(this_obj_conv); } @@ -21863,6 +26113,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ReplyChannelRange_get_cha LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -21872,6 +26123,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_chain_hash LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21882,6 +26134,7 @@ int32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_get_first_b LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -21890,6 +26143,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_first_bloc LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -21897,6 +26151,7 @@ int32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_get_number_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -21905,6 +26160,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_number_of_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -21912,6 +26168,7 @@ jboolean __attribute__((visibility("default"))) TS_ReplyChannelRange_get_sync_c LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyChannelRange_get_sync_complete(&this_ptr_conv); return ret_val; } @@ -21920,6 +26177,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_sync_compl LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); } @@ -21927,6 +26185,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_short_chan LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -21960,6 +26219,7 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_new(int8_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21967,14 +26227,37 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_new(int8_t return ret_ref; } +static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ReplyChannelRange_clone_ptr(uint32_t arg) { + LDKReplyChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_clone(uint32_t orig) { LDKReplyChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21986,6 +26269,7 @@ void __attribute__((visibility("default"))) TS_QueryShortChannelIds_free(uint32 LDKQueryShortChannelIds this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryShortChannelIds_free(this_obj_conv); } @@ -21993,6 +26277,7 @@ int8_tArray __attribute__((visibility("default"))) TS_QueryShortChannelIds_get_ LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -22002,6 +26287,7 @@ void __attribute__((visibility("default"))) TS_QueryShortChannelIds_set_chain_h LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -22012,6 +26298,7 @@ void __attribute__((visibility("default"))) TS_QueryShortChannelIds_set_short_c LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22045,6 +26332,7 @@ uint32_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_new(int uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22052,14 +26340,37 @@ uint32_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_new(int return ret_ref; } +static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_clone_ptr(uint32_t arg) { + LDKQueryShortChannelIds arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_clone(uint32_t orig) { LDKQueryShortChannelIds orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22071,6 +26382,7 @@ void __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_free(uin LDKReplyShortChannelIdsEnd this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyShortChannelIdsEnd_free(this_obj_conv); } @@ -22078,6 +26390,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_g LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -22087,6 +26400,7 @@ void __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_set_chai LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -22097,6 +26411,7 @@ jboolean __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_get_ LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); return ret_val; } @@ -22105,6 +26420,7 @@ void __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_set_full LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); } @@ -22116,6 +26432,7 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_new( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22123,14 +26440,37 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_new( return ret_ref; } +static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint32_t arg) { + LDKReplyShortChannelIdsEnd arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_clone(uint32_t orig) { LDKReplyShortChannelIdsEnd orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22142,6 +26482,7 @@ void __attribute__((visibility("default"))) TS_GossipTimestampFilter_free(uint3 LDKGossipTimestampFilter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); GossipTimestampFilter_free(this_obj_conv); } @@ -22149,6 +26490,7 @@ int8_tArray __attribute__((visibility("default"))) TS_GossipTimestampFilter_get LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -22158,6 +26500,7 @@ void __attribute__((visibility("default"))) TS_GossipTimestampFilter_set_chain_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -22168,6 +26511,7 @@ int32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_get_fir LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); return ret_val; } @@ -22176,6 +26520,7 @@ void __attribute__((visibility("default"))) TS_GossipTimestampFilter_set_first_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); } @@ -22183,6 +26528,7 @@ int32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_get_tim LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); return ret_val; } @@ -22191,6 +26537,7 @@ void __attribute__((visibility("default"))) TS_GossipTimestampFilter_set_timest LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); } @@ -22202,6 +26549,7 @@ uint32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_new(in uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22209,14 +26557,37 @@ uint32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_new(in return ret_ref; } +static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_clone_ptr(uint32_t arg) { + LDKGossipTimestampFilter arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_clone(uint32_t orig) { LDKGossipTimestampFilter orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22233,6 +26604,18 @@ void __attribute__((visibility("default"))) TS_ErrorAction_free(uint32_t this_p ErrorAction_free(this_ptr_conv); } +static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ErrorAction_clone_ptr(uint32_t arg) { + LDKErrorAction* arg_conv = (LDKErrorAction*)arg; + int64_t ret_val = ErrorAction_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ErrorAction_clone(uint32_t orig) { LDKErrorAction* orig_conv = (LDKErrorAction*)orig; LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); @@ -22245,6 +26628,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorAction_disconnect_peer( LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_disconnect_peer(msg_conv); @@ -22271,6 +26655,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorAction_send_error_messa LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_send_error_message(msg_conv); @@ -22282,6 +26667,7 @@ void __attribute__((visibility("default"))) TS_LightningError_free(uint32_t thi LDKLightningError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LightningError_free(this_obj_conv); } @@ -22289,6 +26675,7 @@ jstring __attribute__((visibility("default"))) TS_LightningError_get_err(uint32 LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = LightningError_get_err(&this_ptr_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -22299,6 +26686,7 @@ void __attribute__((visibility("default"))) TS_LightningError_set_err(uint32_t LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = str_ref_to_owned_c(val); LightningError_set_err(&this_ptr_conv, val_conv); } @@ -22307,6 +26695,7 @@ uint32_t __attribute__((visibility("default"))) TS_LightningError_get_action(ui LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = LightningError_get_action(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -22317,6 +26706,7 @@ void __attribute__((visibility("default"))) TS_LightningError_set_action(uint32 LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); @@ -22334,6 +26724,7 @@ uint32_t __attribute__((visibility("default"))) TS_LightningError_new(jstring e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22341,14 +26732,37 @@ uint32_t __attribute__((visibility("default"))) TS_LightningError_new(jstring e return ret_ref; } +static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { + LDKLightningError ret_var = LightningError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_LightningError_clone_ptr(uint32_t arg) { + LDKLightningError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = LightningError_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_LightningError_clone(uint32_t orig) { LDKLightningError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKLightningError ret_var = LightningError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22360,6 +26774,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_free(uint32_t t LDKCommitmentUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentUpdate_free(this_obj_conv); } @@ -22367,6 +26782,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -22376,6 +26792,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up uint64_t ret_conv_15_ref = 0; CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner; if (ret_conv_15_var.is_owned) { ret_conv_15_ref |= 1; @@ -22391,6 +26808,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_add_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22403,6 +26821,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_add_ LDKUpdateAddHTLC val_conv_15_conv; val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); val_constr.data[p] = val_conv_15_conv; } @@ -22413,6 +26832,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -22422,6 +26842,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up uint64_t ret_conv_19_ref = 0; CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner; if (ret_conv_19_var.is_owned) { ret_conv_19_ref |= 1; @@ -22437,6 +26858,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fulf LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22449,6 +26871,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fulf LDKUpdateFulfillHTLC val_conv_19_conv; val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); val_constr.data[t] = val_conv_19_conv; } @@ -22459,6 +26882,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -22468,6 +26892,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -22483,6 +26908,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fail LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22495,6 +26921,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fail LDKUpdateFailHTLC val_conv_16_conv; val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); val_constr.data[q] = val_conv_16_conv; } @@ -22505,6 +26932,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -22514,6 +26942,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up uint64_t ret_conv_25_ref = 0; CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner; if (ret_conv_25_var.is_owned) { ret_conv_25_ref |= 1; @@ -22529,6 +26958,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fail LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22541,6 +26971,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fail LDKUpdateFailMalformedHTLC val_conv_25_conv; val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); val_constr.data[z] = val_conv_25_conv; } @@ -22551,11 +26982,13 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_get_update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22568,9 +27001,11 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fee( LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UpdateFee_clone(&val_conv); CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); } @@ -22579,10 +27014,12 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_get_commitm LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22594,9 +27031,11 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_commitment_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CommitmentSigned_clone(&val_conv); CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); } @@ -22614,6 +27053,7 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; } @@ -22629,6 +27069,7 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; } @@ -22644,6 +27085,7 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; } @@ -22659,21 +27101,25 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; } LDKUpdateFee update_fee_arg_conv; update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); LDKCommitmentSigned commitment_signed_arg_conv; commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22681,14 +27127,37 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ return ret_ref; } +static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CommitmentUpdate_clone_ptr(uint32_t arg) { + LDKCommitmentUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_clone(uint32_t orig) { LDKCommitmentUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22718,6 +27187,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_write(uint3 LDKAcceptChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22738,6 +27208,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_wr LDKAnnouncementSignatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22758,6 +27229,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelReestablish_write( LDKChannelReestablish obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22778,6 +27250,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingSigned_write(uint3 LDKClosingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22798,6 +27271,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_wri LDKClosingSignedFeeRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22818,6 +27292,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CommitmentSigned_write(ui LDKCommitmentSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22838,6 +27313,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_write(uint LDKFundingCreated obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22858,6 +27334,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingSigned_write(uint3 LDKFundingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22878,6 +27355,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingLocked_write(uint3 LDKFundingLocked obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22898,6 +27376,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Init_write(uint32_t obj) LDKInit obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Init_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22918,6 +27397,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_write(uint32_ LDKOpenChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22938,6 +27418,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_write(uint32 LDKRevokeAndACK obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22958,6 +27439,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Shutdown_write(uint32_t o LDKShutdown obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22978,6 +27460,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFailHTLC_write(uint LDKUpdateFailHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22998,6 +27481,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_w LDKUpdateFailMalformedHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23018,6 +27502,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFee_write(uint32_t LDKUpdateFee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23038,6 +27523,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_write(u LDKUpdateFulfillHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23058,6 +27544,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateAddHTLC_write(uint3 LDKUpdateAddHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23078,6 +27565,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Ping_write(uint32_t obj) LDKPing obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Ping_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23098,6 +27586,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Pong_write(uint32_t obj) LDKPong obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Pong_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23118,6 +27607,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23138,6 +27628,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_write LDKChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23158,6 +27649,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_wri LDKUnsignedChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23178,6 +27670,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelUpdate_write(uint3 LDKChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23198,6 +27691,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ErrorMessage_write(uint32 LDKErrorMessage obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23218,6 +27712,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_ LDKUnsignedNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23238,6 +27733,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncement_write(ui LDKNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23267,6 +27763,7 @@ int8_tArray __attribute__((visibility("default"))) TS_QueryShortChannelIds_writ LDKQueryShortChannelIds obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23278,6 +27775,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_w LDKReplyShortChannelIdsEnd obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23298,6 +27796,7 @@ int32_t __attribute__((visibility("default"))) TS_QueryChannelRange_end_blocknu LDKQueryChannelRange this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv); return ret_val; } @@ -23306,6 +27805,7 @@ int8_tArray __attribute__((visibility("default"))) TS_QueryChannelRange_write(u LDKQueryChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23335,6 +27835,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ReplyChannelRange_write(u LDKReplyChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23346,6 +27847,7 @@ int8_tArray __attribute__((visibility("default"))) TS_GossipTimestampFilter_wri LDKGossipTimestampFilter obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23375,6 +27877,7 @@ void __attribute__((visibility("default"))) TS_IgnoringMessageHandler_free(uint LDKIgnoringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); IgnoringMessageHandler_free(this_obj_conv); } @@ -23383,6 +27886,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_new() uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23394,6 +27898,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Me LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -23403,6 +27908,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Ro LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -23412,6 +27918,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Cu LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); return (uint64_t)ret_ret; @@ -23421,6 +27928,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Cu LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -23430,6 +27938,7 @@ void __attribute__((visibility("default"))) TS_ErroringMessageHandler_free(uint LDKErroringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErroringMessageHandler_free(this_obj_conv); } @@ -23438,6 +27947,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_new() uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23449,6 +27959,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_as_Me LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -23458,6 +27969,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_as_Ch LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -23467,6 +27979,7 @@ void __attribute__((visibility("default"))) TS_MessageHandler_free(uint32_t thi LDKMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MessageHandler_free(this_obj_conv); } @@ -23474,6 +27987,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_get_chan_hand LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -23483,6 +27997,7 @@ void __attribute__((visibility("default"))) TS_MessageHandler_set_chan_handler( LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); @@ -23493,6 +28008,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_get_route_han LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -23502,6 +28018,7 @@ void __attribute__((visibility("default"))) TS_MessageHandler_set_route_handler LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); @@ -23519,6 +28036,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_new(uint32_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23526,6 +28044,19 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_new(uint32_t return ret_ref; } +static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(arg); + return (uint64_t)ret_ret; +} +int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; + int64_t ret_val = SocketDescriptor_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_SocketDescriptor_clone(uint32_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -23548,6 +28079,7 @@ void __attribute__((visibility("default"))) TS_PeerHandleError_free(uint32_t th LDKPeerHandleError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerHandleError_free(this_obj_conv); } @@ -23555,6 +28087,7 @@ jboolean __attribute__((visibility("default"))) TS_PeerHandleError_get_no_conne LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv); return ret_val; } @@ -23563,6 +28096,7 @@ void __attribute__((visibility("default"))) TS_PeerHandleError_set_no_connectio LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); } @@ -23571,6 +28105,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_new(jboolean uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23578,14 +28113,37 @@ uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_new(jboolean return ret_ref; } +static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { + LDKPeerHandleError ret_var = PeerHandleError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PeerHandleError_clone_ptr(uint32_t arg) { + LDKPeerHandleError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PeerHandleError_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_clone(uint32_t orig) { LDKPeerHandleError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23597,6 +28155,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_free(uint32_t this_o LDKPeerManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerManager_free(this_obj_conv); } @@ -23604,6 +28163,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_new(uint32_t mes LDKMessageHandler message_handler_conv; message_handler_conv.inner = (void*)(message_handler & (~1)); message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); // Warning: we need a move here but no clone is available for LDKMessageHandler LDKSecretKey our_node_secret_ref; CHECK(*((uint32_t*)our_node_secret) == 32); @@ -23622,6 +28182,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_new(uint32_t mes uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23633,6 +28194,7 @@ ptrArray __attribute__((visibility("default"))) TS_PeerManager_get_peer_node_id LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); ptrArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes"); @@ -23651,6 +28213,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_new_outbound_con LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -23666,6 +28229,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_new_inbound_conn LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); @@ -23678,6 +28242,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_write_buffer_spa LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -23690,6 +28255,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_read_event(uint3 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1); if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; @@ -23705,6 +28271,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_process_events(uint3 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_process_events(&this_arg_conv); } @@ -23712,6 +28279,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_socket_disconnected( LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -23722,6 +28290,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_disconnect_by_node_i LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey node_id_ref; CHECK(*((uint32_t*)node_id) == 33); memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33); @@ -23732,6 +28301,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_disconnect_all_peers LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_disconnect_all_peers(&this_arg_conv); } @@ -23739,6 +28309,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_timer_tick_occurred( LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_timer_tick_occurred(&this_arg_conv); } @@ -23764,6 +28335,7 @@ int8_tArray __attribute__((visibility("default"))) TS_build_closing_transaction LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -23827,6 +28399,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_free(uint32_t thi LDKTxCreationKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TxCreationKeys_free(this_obj_conv); } @@ -23834,6 +28407,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_per_co LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23843,6 +28417,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_per_commitmen LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23853,6 +28428,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_revoca LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23862,6 +28438,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_revocation_ke LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23872,6 +28449,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_broadc LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23881,6 +28459,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_broadcaster_h LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23891,6 +28470,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_counte LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23900,6 +28480,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_countersignat LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23910,6 +28491,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_broadc LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23919,6 +28501,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_broadcaster_d LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23945,6 +28528,7 @@ uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_new(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23952,14 +28536,37 @@ uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_new(int8_tArr return ret_ref; } +static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { + LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_TxCreationKeys_clone_ptr(uint32_t arg) { + LDKTxCreationKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_clone(uint32_t orig) { LDKTxCreationKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23971,6 +28578,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_write(uint LDKTxCreationKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23991,6 +28599,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_free(uint32_t LDKChannelPublicKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelPublicKeys_free(this_obj_conv); } @@ -23998,6 +28607,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_fun LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24007,6 +28617,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_funding_pu LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24017,6 +28628,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_rev LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24026,6 +28638,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_revocation LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24036,6 +28649,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_pay LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24045,6 +28659,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_payment_po LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24055,6 +28670,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_del LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24064,6 +28680,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_delayed_pa LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24074,6 +28691,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_htl LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24083,6 +28701,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_htlc_basep LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24109,6 +28728,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_new(int8_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24116,14 +28736,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_new(int8_t return ret_ref; } +static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_clone_ptr(uint32_t arg) { + LDKChannelPublicKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_clone(uint32_t orig) { LDKChannelPublicKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24135,6 +28778,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_write(u LDKChannelPublicKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24179,9 +28823,11 @@ uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_from_channel_ LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -24205,6 +28851,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_free(uint LDKHTLCOutputInCommitment this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCOutputInCommitment_free(this_obj_conv); } @@ -24212,6 +28859,7 @@ jboolean __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_o LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv); return ret_val; } @@ -24220,6 +28868,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_offer LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); } @@ -24227,6 +28876,7 @@ int64_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_am LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -24235,6 +28885,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_amoun LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); } @@ -24242,6 +28893,7 @@ int32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_cl LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -24250,6 +28902,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_cltv_ LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); } @@ -24257,6 +28910,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_ge LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32); return ret_arr; @@ -24266,6 +28920,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_payme LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -24276,6 +28931,7 @@ uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_t LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -24286,6 +28942,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_trans LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -24305,6 +28962,7 @@ uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_new(j uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24312,14 +28970,37 @@ uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_new(j return ret_ref; } +static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_clone_ptr(uint32_t arg) { + LDKHTLCOutputInCommitment arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_clone(uint32_t orig) { LDKHTLCOutputInCommitment orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24331,6 +29012,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_wr LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24351,9 +29033,11 @@ int8_tArray __attribute__((visibility("default"))) TS_get_htlc_redeemscript(uin LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKTxCreationKeys keys_conv; keys_conv.inner = (void*)(keys & (~1)); keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24383,6 +29067,7 @@ int8_tArray __attribute__((visibility("default"))) TS_build_htlc_transaction(in LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK(*((uint32_t*)broadcaster_delayed_payment_key) == 33); memcpy(broadcaster_delayed_payment_key_ref.compressed_form, (uint8_t*)(broadcaster_delayed_payment_key + 4), 33); @@ -24400,6 +29085,7 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_fre LDKChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelTransactionParameters_free(this_obj_conv); } @@ -24407,10 +29093,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24422,9 +29110,11 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } @@ -24433,6 +29123,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_ LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -24441,6 +29132,7 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } @@ -24448,6 +29140,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); return ret_val; } @@ -24456,6 +29149,7 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); } @@ -24463,11 +29157,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24480,9 +29176,11 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); } @@ -24491,11 +29189,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24508,9 +29208,11 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } @@ -24519,19 +29221,23 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); LDKOutPoint funding_outpoint_arg_conv; funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24539,14 +29245,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters return ret_ref; } +static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_clone_ptr(uint32_t arg) { + LDKChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_clone(uint32_t orig) { LDKChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24558,6 +29287,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionPa LDKCounterpartyChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyChannelTransactionParameters_free(this_obj_conv); } @@ -24565,10 +29295,12 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransacti LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24580,9 +29312,11 @@ void __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionPa LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } @@ -24591,6 +29325,7 @@ int16_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransactio LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -24599,6 +29334,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionPa LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } @@ -24606,11 +29342,13 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransacti LDKChannelPublicKeys pubkeys_arg_conv; pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24618,14 +29356,37 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransacti return ret_ref; } +static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint32_t arg) { + LDKCounterpartyChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionParameters_clone(uint32_t orig) { LDKCounterpartyChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24637,6 +29398,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelTransactionParameters_is_populated(&this_arg_conv); return ret_val; } @@ -24645,10 +29407,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24660,10 +29424,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24675,6 +29441,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CounterpartyChannelTransa LDKCounterpartyChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24695,6 +29462,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelTransactionParamet LDKChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24715,6 +29483,7 @@ void __attribute__((visibility("default"))) TS_DirectedChannelTransactionParame LDKDirectedChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectedChannelTransactionParameters_free(this_obj_conv); } @@ -24722,10 +29491,12 @@ uint32_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24737,10 +29508,12 @@ uint32_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24752,6 +29525,7 @@ int16_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPar LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); return ret_val; } @@ -24760,6 +29534,7 @@ jboolean __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); return ret_val; } @@ -24768,10 +29543,12 @@ uint32_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24783,6 +29560,7 @@ void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_free LDKHolderCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HolderCommitmentTransaction_free(this_obj_conv); } @@ -24790,6 +29568,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HolderCommitmentTransacti LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -24799,6 +29578,7 @@ void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_set_ LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -24809,6 +29589,7 @@ void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_set_ LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -24826,14 +29607,37 @@ void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_set_ HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } +static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_clone_ptr(uint32_t arg) { + LDKHolderCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_clone(uint32_t orig) { LDKHolderCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24845,6 +29649,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HolderCommitmentTransacti LDKHolderCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24865,6 +29670,7 @@ uint32_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_ LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); LDKSignature counterparty_sig_ref; CHECK(*((uint32_t*)counterparty_sig) == 64); @@ -24893,6 +29699,7 @@ uint32_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24904,6 +29711,7 @@ void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_free( LDKBuiltCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BuiltCommitmentTransaction_free(this_obj_conv); } @@ -24911,6 +29719,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24922,6 +29731,7 @@ void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_set_t LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction val_ref; val_ref.datalen = *((uint32_t*)val); val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); @@ -24934,6 +29744,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32); return ret_arr; @@ -24943,6 +29754,7 @@ void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_set_t LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -24962,6 +29774,7 @@ uint32_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_n uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24969,14 +29782,37 @@ uint32_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_n return ret_ref; } +static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_clone_ptr(uint32_t arg) { + LDKBuiltCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_clone(uint32_t orig) { LDKBuiltCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24988,6 +29824,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25008,6 +29845,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = *((uint32_t*)funding_redeemscript); funding_redeemscript_ref.data = (int8_t*)(funding_redeemscript + 4); @@ -25020,6 +29858,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK(*((uint32_t*)funding_key) == 32); memcpy(funding_key_arr, (uint8_t*)(funding_key + 4), 32); @@ -25036,17 +29875,41 @@ void __attribute__((visibility("default"))) TS_ClosingTransaction_free(uint32_t LDKClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingTransaction_free(this_obj_conv); } +static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { + LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_clone_ptr(uint32_t arg) { + LDKClosingTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_clone(uint32_t orig) { LDKClosingTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25058,6 +29921,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_hash(uint3 LDKClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ClosingTransaction_hash(&o_conv); return ret_val; } @@ -25074,11 +29938,13 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_new(int64 LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25090,10 +29956,12 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_trust(uin LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25105,9 +29973,11 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_verify(ui LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); @@ -25118,6 +29988,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_to_holder_ LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_holder_value_sat(&this_arg_conv); return ret_val; } @@ -25126,6 +29997,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_to_counter LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); return ret_val; } @@ -25134,6 +30006,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingTransaction_to_hol LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25144,6 +30017,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingTransaction_to_cou LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25154,6 +30028,7 @@ void __attribute__((visibility("default"))) TS_TrustedClosingTransaction_free(u LDKTrustedClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedClosingTransaction_free(this_obj_conv); } @@ -25161,6 +30036,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TrustedClosingTransaction LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25172,6 +30048,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TrustedClosingTransaction LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = *((uint32_t*)funding_redeemscript); funding_redeemscript_ref.data = (int8_t*)(funding_redeemscript + 4); @@ -25184,6 +30061,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TrustedClosingTransaction LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK(*((uint32_t*)funding_key) == 32); memcpy(funding_key_arr, (uint8_t*)(funding_key + 4), 32); @@ -25200,17 +30078,41 @@ void __attribute__((visibility("default"))) TS_CommitmentTransaction_free(uint3 LDKCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentTransaction_free(this_obj_conv); } +static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CommitmentTransaction_clone_ptr(uint32_t arg) { + LDKCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_clone(uint32_t orig) { LDKCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25222,6 +30124,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CommitmentTransaction_wri LDKCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25242,6 +30145,7 @@ int64_t __attribute__((visibility("default"))) TS_CommitmentTransaction_commitm LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_commitment_number(&this_arg_conv); return ret_val; } @@ -25250,6 +30154,7 @@ int64_t __attribute__((visibility("default"))) TS_CommitmentTransaction_to_broa LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); return ret_val; } @@ -25258,6 +30163,7 @@ int64_t __attribute__((visibility("default"))) TS_CommitmentTransaction_to_coun LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); return ret_val; } @@ -25266,6 +30172,7 @@ int32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_feerate LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = CommitmentTransaction_feerate_per_kw(&this_arg_conv); return ret_val; } @@ -25274,10 +30181,12 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_trust( LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25289,15 +30198,19 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_verify LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -25307,6 +30220,7 @@ void __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_fre LDKTrustedCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedCommitmentTransaction_free(this_obj_conv); } @@ -25314,6 +30228,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TrustedCommitmentTransact LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32); return ret_arr; @@ -25323,10 +30238,12 @@ uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25338,10 +30255,12 @@ uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25353,6 +30272,7 @@ uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char htlc_base_key_arr[32]; CHECK(*((uint32_t*)htlc_base_key) == 32); memcpy(htlc_base_key_arr, (uint8_t*)(htlc_base_key + 4), 32); @@ -25360,6 +30280,7 @@ uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); return (uint64_t)ret_conv; @@ -25380,9 +30301,11 @@ jboolean __attribute__((visibility("default"))) TS_InitFeatures_eq(uint32_t a, LDKInitFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInitFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InitFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -25391,9 +30314,11 @@ jboolean __attribute__((visibility("default"))) TS_NodeFeatures_eq(uint32_t a, LDKNodeFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKNodeFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = NodeFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -25402,9 +30327,11 @@ jboolean __attribute__((visibility("default"))) TS_ChannelFeatures_eq(uint32_t LDKChannelFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKChannelFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ChannelFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -25413,21 +30340,46 @@ jboolean __attribute__((visibility("default"))) TS_InvoiceFeatures_eq(uint32_t LDKInvoiceFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceFeatures_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InitFeatures_clone_ptr(uint32_t arg) { + LDKInitFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InitFeatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InitFeatures_clone(uint32_t orig) { LDKInitFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25435,14 +30387,37 @@ uint32_t __attribute__((visibility("default"))) TS_InitFeatures_clone(uint32_t return ret_ref; } +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeFeatures_clone_ptr(uint32_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeFeatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_clone(uint32_t orig) { LDKNodeFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25450,14 +30425,37 @@ uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_clone(uint32_t return ret_ref; } +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelFeatures_clone_ptr(uint32_t arg) { + LDKChannelFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_clone(uint32_t orig) { LDKChannelFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25465,14 +30463,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_clone(uint32 return ret_ref; } +static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InvoiceFeatures_clone_ptr(uint32_t arg) { + LDKInvoiceFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_clone(uint32_t orig) { LDKInvoiceFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25484,6 +30505,7 @@ void __attribute__((visibility("default"))) TS_InitFeatures_free(uint32_t this_ LDKInitFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InitFeatures_free(this_obj_conv); } @@ -25491,6 +30513,7 @@ void __attribute__((visibility("default"))) TS_NodeFeatures_free(uint32_t this_ LDKNodeFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeFeatures_free(this_obj_conv); } @@ -25498,6 +30521,7 @@ void __attribute__((visibility("default"))) TS_ChannelFeatures_free(uint32_t th LDKChannelFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelFeatures_free(this_obj_conv); } @@ -25505,6 +30529,7 @@ void __attribute__((visibility("default"))) TS_InvoiceFeatures_free(uint32_t th LDKInvoiceFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceFeatures_free(this_obj_conv); } @@ -25513,6 +30538,7 @@ uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25525,6 +30551,7 @@ uint32_t __attribute__((visibility("default"))) TS_InitFeatures_known() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25536,6 +30563,7 @@ jboolean __attribute__((visibility("default"))) TS_InitFeatures_requires_unknow LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -25545,6 +30573,7 @@ uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_empty() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25557,6 +30586,7 @@ uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_known() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25568,6 +30598,7 @@ jboolean __attribute__((visibility("default"))) TS_NodeFeatures_requires_unknow LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -25577,6 +30608,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_empty() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25589,6 +30621,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_known() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25600,6 +30633,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelFeatures_requires_unk LDKChannelFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -25609,6 +30643,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_empty() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25621,6 +30656,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_known() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25632,6 +30668,7 @@ jboolean __attribute__((visibility("default"))) TS_InvoiceFeatures_requires_unk LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -25640,6 +30677,7 @@ jboolean __attribute__((visibility("default"))) TS_InitFeatures_supports_paymen LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -25648,6 +30686,7 @@ jboolean __attribute__((visibility("default"))) TS_NodeFeatures_supports_paymen LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -25656,6 +30695,7 @@ jboolean __attribute__((visibility("default"))) TS_InvoiceFeatures_supports_pay LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -25664,6 +30704,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InitFeatures_write(uint32 LDKInitFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25675,6 +30716,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeFeatures_write(uint32 LDKNodeFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25686,6 +30728,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelFeatures_write(uin LDKChannelFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25697,6 +30740,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InvoiceFeatures_write(uin LDKInvoiceFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25744,17 +30788,41 @@ void __attribute__((visibility("default"))) TS_ShutdownScript_free(uint32_t thi LDKShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ShutdownScript_free(this_obj_conv); } +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ShutdownScript_clone_ptr(uint32_t arg) { + LDKShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ShutdownScript_clone(uint32_t orig) { LDKShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25766,6 +30834,7 @@ void __attribute__((visibility("default"))) TS_InvalidShutdownScript_free(uint3 LDKInvalidShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvalidShutdownScript_free(this_obj_conv); } @@ -25773,6 +30842,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InvalidShutdownScript_get LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25783,6 +30853,7 @@ void __attribute__((visibility("default"))) TS_InvalidShutdownScript_set_script LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = *((uint32_t*)val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -25799,6 +30870,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_new(in uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25806,14 +30878,37 @@ uint32_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_new(in return ret_ref; } +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_clone_ptr(uint32_t arg) { + LDKInvalidShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_clone(uint32_t orig) { LDKInvalidShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25825,6 +30920,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ShutdownScript_write(uint LDKShutdownScript obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25850,6 +30946,7 @@ uint32_t __attribute__((visibility("default"))) TS_ShutdownScript_new_p2wpkh(in uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25866,6 +30963,7 @@ uint32_t __attribute__((visibility("default"))) TS_ShutdownScript_new_p2wsh(int uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25886,6 +30984,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ShutdownScript_into_inner LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = ShutdownScript_clone(&this_arg_conv); LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -25898,6 +30997,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ShutdownScript_as_legacy_ LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); return ret_arr; @@ -25907,9 +31007,11 @@ jboolean __attribute__((visibility("default"))) TS_ShutdownScript_is_compatible LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInitFeatures features_conv; features_conv.inner = (void*)(features & (~1)); features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); jboolean ret_val = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_val; } @@ -25923,6 +31025,19 @@ void __attribute__((visibility("default"))) TS_CustomMessageReader_free(uint32_ CustomMessageReader_free(this_ptr_conv); } +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return (uint64_t)ret_ret; +} +int64_t __attribute__((visibility("default"))) TS_Type_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_val = Type_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Type_clone(uint32_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -25954,6 +31069,7 @@ void __attribute__((visibility("default"))) TS_LockableScore_free(uint32_t this LDKLockableScore this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockableScore_free(this_obj_conv); } @@ -25965,6 +31081,7 @@ uint32_t __attribute__((visibility("default"))) TS_LockableScore_new(uint32_t s uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25976,6 +31093,7 @@ int8_tArray __attribute__((visibility("default"))) TS_LockableScore_write(uint3 LDKLockableScore obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25987,17 +31105,41 @@ void __attribute__((visibility("default"))) TS_NodeId_free(uint32_t this_obj) { LDKNodeId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeId_free(this_obj_conv); } +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeId_clone_ptr(uint32_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeId_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeId_clone(uint32_t orig) { LDKNodeId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeId ret_var = NodeId_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26013,6 +31155,7 @@ uint32_t __attribute__((visibility("default"))) TS_NodeId_from_pubkey(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26024,6 +31167,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeId_as_slice(uint32_t LDKNodeId this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26034,6 +31178,7 @@ int64_t __attribute__((visibility("default"))) TS_NodeId_hash(uint32_t o) { LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = NodeId_hash(&o_conv); return ret_val; } @@ -26042,6 +31187,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeId_write(uint32_t obj LDKNodeId obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26062,17 +31208,41 @@ void __attribute__((visibility("default"))) TS_NetworkGraph_free(uint32_t this_ LDKNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetworkGraph_free(this_obj_conv); } +static inline uint64_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { + LDKNetworkGraph ret_var = NetworkGraph_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NetworkGraph_clone_ptr(uint32_t arg) { + LDKNetworkGraph arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NetworkGraph_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_clone(uint32_t orig) { LDKNetworkGraph orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26084,6 +31254,7 @@ void __attribute__((visibility("default"))) TS_ReadOnlyNetworkGraph_free(uint32 LDKReadOnlyNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReadOnlyNetworkGraph_free(this_obj_conv); } @@ -26096,6 +31267,18 @@ void __attribute__((visibility("default"))) TS_NetworkUpdate_free(uint32_t this NetworkUpdate_free(this_ptr_conv); } +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NetworkUpdate_clone_ptr(uint32_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)arg; + int64_t ret_val = NetworkUpdate_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NetworkUpdate_clone(uint32_t orig) { LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)orig; LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); @@ -26108,6 +31291,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkUpdate_channel_update LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_update_message(msg_conv); @@ -26141,10 +31325,20 @@ int8_tArray __attribute__((visibility("default"))) TS_NetworkUpdate_write(uint3 return ret_arr; } +uint32_t __attribute__((visibility("default"))) TS_NetworkUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = *((uint32_t*)ser); + ser_ref.data = (int8_t*)(ser + 4); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + return (uint64_t)ret_conv; +} + uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_as_EventHandler(uint32_t this_arg) { LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26154,6 +31348,7 @@ void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_free(uint32_t LDKNetGraphMsgHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetGraphMsgHandler_free(this_obj_conv); } @@ -26161,6 +31356,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_new(uint3 LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -26175,6 +31371,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_new(uint3 uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26186,6 +31383,7 @@ void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_add_chain_acc LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -26200,6 +31398,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_as_Routin LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26209,6 +31408,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_as_Messag LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -26218,6 +31418,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_free(uint LDKDirectionalChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectionalChannelInfo_free(this_obj_conv); } @@ -26225,6 +31426,7 @@ int32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_la LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = DirectionalChannelInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -26233,6 +31435,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_last_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_last_update(&this_ptr_conv, val); } @@ -26240,6 +31443,7 @@ jboolean __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_e LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = DirectionalChannelInfo_get_enabled(&this_ptr_conv); return ret_val; } @@ -26248,6 +31452,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_enabl LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_enabled(&this_ptr_conv, val); } @@ -26255,6 +31460,7 @@ int16_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_cl LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -26263,6 +31469,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_cltv_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -26270,6 +31477,7 @@ int64_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_ht LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DirectionalChannelInfo_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -26278,6 +31486,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_htlc_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -26285,6 +31494,7 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_h LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -26295,6 +31505,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_htlc_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -26306,10 +31517,12 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_f LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26321,9 +31534,11 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_fees( LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); DirectionalChannelInfo_set_fees(&this_ptr_conv, val_conv); } @@ -26332,11 +31547,13 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_l LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26349,9 +31566,11 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_last_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelUpdate_clone(&val_conv); DirectionalChannelInfo_set_last_update_message(&this_ptr_conv, val_conv); } @@ -26364,15 +31583,18 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_new(i LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); LDKChannelUpdate last_update_message_arg_conv; last_update_message_arg_conv.inner = (void*)(last_update_message_arg & (~1)); last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26380,14 +31602,37 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_new(i return ret_ref; } +static inline uint64_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg) { + LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_clone_ptr(uint32_t arg) { + LDKDirectionalChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_clone(uint32_t orig) { LDKDirectionalChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26399,6 +31644,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DirectionalChannelInfo_wr LDKDirectionalChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26419,6 +31665,7 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_free(uint32_t this_o LDKChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelInfo_free(this_obj_conv); } @@ -26426,10 +31673,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_features(uin LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26441,9 +31690,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_features(uint32_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); ChannelInfo_set_features(&this_ptr_conv, val_conv); } @@ -26452,10 +31703,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_node_one(uin LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26467,9 +31720,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_node_one(uint32_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } @@ -26478,11 +31733,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_one_to_two(u LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26495,9 +31752,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_one_to_two(uint3 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); } @@ -26506,10 +31765,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_node_two(uin LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26521,9 +31782,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_node_two(uint32_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } @@ -26532,11 +31795,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_two_to_one(u LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26549,9 +31814,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_two_to_one(uint3 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } @@ -26560,6 +31827,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_capacity_sat LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -26570,6 +31838,7 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_capacity_sats(ui LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -26581,11 +31850,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_announcement LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26598,9 +31869,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_announcement_mes LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelAnnouncement_clone(&val_conv); ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -26609,22 +31882,27 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t fea LDKChannelFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = ChannelFeatures_clone(&features_arg_conv); LDKNodeId node_one_arg_conv; node_one_arg_conv.inner = (void*)(node_one_arg & (~1)); node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv); node_one_arg_conv = NodeId_clone(&node_one_arg_conv); LDKDirectionalChannelInfo one_to_two_arg_conv; one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1)); one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv); one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv); LDKNodeId node_two_arg_conv; node_two_arg_conv.inner = (void*)(node_two_arg & (~1)); node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv); node_two_arg_conv = NodeId_clone(&node_two_arg_conv); LDKDirectionalChannelInfo two_to_one_arg_conv; two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1)); two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv); two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv); void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1); CHECK_ACCESS(capacity_sats_arg_ptr); @@ -26633,11 +31911,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t fea LDKChannelAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv); LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26645,14 +31925,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t fea return ret_ref; } +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelInfo_clone_ptr(uint32_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_clone(uint32_t orig) { LDKChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26664,6 +31967,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelInfo_write(uint32_ LDKChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26684,6 +31988,7 @@ void __attribute__((visibility("default"))) TS_RoutingFees_free(uint32_t this_o LDKRoutingFees this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RoutingFees_free(this_obj_conv); } @@ -26691,6 +31996,7 @@ int32_t __attribute__((visibility("default"))) TS_RoutingFees_get_base_msat(uin LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_base_msat(&this_ptr_conv); return ret_val; } @@ -26699,6 +32005,7 @@ void __attribute__((visibility("default"))) TS_RoutingFees_set_base_msat(uint32 LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_base_msat(&this_ptr_conv, val); } @@ -26706,6 +32013,7 @@ int32_t __attribute__((visibility("default"))) TS_RoutingFees_get_proportional_ LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -26714,6 +32022,7 @@ void __attribute__((visibility("default"))) TS_RoutingFees_set_proportional_mil LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } @@ -26722,6 +32031,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingFees_new(int32_t base uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26733,21 +32043,46 @@ jboolean __attribute__((visibility("default"))) TS_RoutingFees_eq(uint32_t a, u LDKRoutingFees a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoutingFees b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RoutingFees_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RoutingFees_clone_ptr(uint32_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RoutingFees_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RoutingFees_clone(uint32_t orig) { LDKRoutingFees orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26759,6 +32094,7 @@ int64_t __attribute__((visibility("default"))) TS_RoutingFees_hash(uint32_t o) LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RoutingFees_hash(&o_conv); return ret_val; } @@ -26767,6 +32103,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RoutingFees_write(uint32_ LDKRoutingFees obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26787,6 +32124,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_free(uint32 LDKNodeAnnouncementInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncementInfo_free(this_obj_conv); } @@ -26794,10 +32132,12 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_fea LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26809,9 +32149,11 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_feature LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); } @@ -26820,6 +32162,7 @@ int32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_last LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -26828,6 +32171,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_last_up LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); } @@ -26835,6 +32179,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_ LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(3, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3); return ret_arr; @@ -26844,6 +32189,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_rgb(uin LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK(*((uint32_t*)val) == 3); memcpy(val_ref.data, (uint8_t*)(val + 4), 3); @@ -26854,6 +32200,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_ LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *NodeAnnouncementInfo_get_alias(&this_ptr_conv), 32); return ret_arr; @@ -26863,6 +32210,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_alias(u LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -26873,6 +32221,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_address LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -26895,11 +32244,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_ann LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26912,9 +32263,11 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_announc LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncement_clone(&val_conv); NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -26923,6 +32276,7 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_new(uin LDKNodeFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = NodeFeatures_clone(&features_arg_conv); LDKThreeBytes rgb_arg_ref; CHECK(*((uint32_t*)rgb_arg) == 3); @@ -26947,11 +32301,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_new(uin LDKNodeAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, announcement_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26959,14 +32315,37 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_new(uin return ret_ref; } +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_clone_ptr(uint32_t arg) { + LDKNodeAnnouncementInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_clone(uint32_t orig) { LDKNodeAnnouncementInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26978,6 +32357,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_writ LDKNodeAnnouncementInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26998,6 +32378,7 @@ void __attribute__((visibility("default"))) TS_NodeInfo_free(uint32_t this_obj) LDKNodeInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeInfo_free(this_obj_conv); } @@ -27005,6 +32386,7 @@ void __attribute__((visibility("default"))) TS_NodeInfo_set_channels(uint32_t t LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -27023,11 +32405,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeInfo_get_lowest_inbound_ LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27040,9 +32424,11 @@ void __attribute__((visibility("default"))) TS_NodeInfo_set_lowest_inbound_chan LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv); } @@ -27051,11 +32437,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeInfo_get_announcement_in LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27068,9 +32456,11 @@ void __attribute__((visibility("default"))) TS_NodeInfo_set_announcement_info(u LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncementInfo_clone(&val_conv); NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } @@ -27090,15 +32480,18 @@ uint32_t __attribute__((visibility("default"))) TS_NodeInfo_new(int64_tArray ch LDKRoutingFees lowest_inbound_channel_fees_arg_conv; lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1)); lowest_inbound_channel_fees_arg_conv.is_owned = (lowest_inbound_channel_fees_arg & 1) || (lowest_inbound_channel_fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv); lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv); LDKNodeAnnouncementInfo announcement_info_arg_conv; announcement_info_arg_conv.inner = (void*)(announcement_info_arg & (~1)); announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27106,14 +32499,37 @@ uint32_t __attribute__((visibility("default"))) TS_NodeInfo_new(int64_tArray ch return ret_ref; } +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeInfo_clone_ptr(uint32_t arg) { + LDKNodeInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeInfo_clone(uint32_t orig) { LDKNodeInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27125,6 +32541,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeInfo_write(uint32_t o LDKNodeInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27145,6 +32562,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NetworkGraph_write(uint32 LDKNetworkGraph obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27169,6 +32587,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27180,10 +32599,12 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_read_only(uint3 LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27195,9 +32616,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_node_fro LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -27207,9 +32630,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_node_fro LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -27219,9 +32644,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -27238,9 +32665,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -27257,6 +32686,7 @@ void __attribute__((visibility("default"))) TS_NetworkGraph_close_channel_from_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent); } @@ -27264,6 +32694,7 @@ void __attribute__((visibility("default"))) TS_NetworkGraph_fail_node(uint32_t LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey _node_id_ref; CHECK(*((uint32_t*)_node_id) == 33); memcpy(_node_id_ref.compressed_form, (uint8_t*)(_node_id + 4), 33); @@ -27274,9 +32705,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel( LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -27286,9 +32719,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -27298,6 +32733,7 @@ uint32_t __attribute__((visibility("default"))) TS_ReadOnlyNetworkGraph_get_add LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey pubkey_ref; CHECK(*((uint32_t*)pubkey) == 33); memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33); @@ -27311,6 +32747,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_free(uint32_t this_obj) LDKRouteHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHop_free(this_obj_conv); } @@ -27318,6 +32755,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHop_get_pubkey(uint3 LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -27327,6 +32765,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_pubkey(uint32_t thi LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -27337,10 +32776,12 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_get_node_features(u LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27352,9 +32793,11 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_node_features(uint3 LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); RouteHop_set_node_features(&this_ptr_conv, val_conv); } @@ -27363,6 +32806,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHop_get_short_channel_id LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -27371,6 +32815,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_short_channel_id(ui LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_short_channel_id(&this_ptr_conv, val); } @@ -27378,10 +32823,12 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_get_channel_feature LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27393,9 +32840,11 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_channel_features(ui LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); RouteHop_set_channel_features(&this_ptr_conv, val_conv); } @@ -27404,6 +32853,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHop_get_fee_msat(uint32_ LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_fee_msat(&this_ptr_conv); return ret_val; } @@ -27412,6 +32862,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_fee_msat(uint32_t t LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_fee_msat(&this_ptr_conv, val); } @@ -27419,6 +32870,7 @@ int32_t __attribute__((visibility("default"))) TS_RouteHop_get_cltv_expiry_delt LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -27427,6 +32879,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_cltv_expiry_delta(u LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -27437,15 +32890,18 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_new(int8_tArray pub LDKNodeFeatures node_features_arg_conv; node_features_arg_conv.inner = (void*)(node_features_arg & (~1)); node_features_arg_conv.is_owned = (node_features_arg & 1) || (node_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); LDKChannelFeatures channel_features_arg_conv; channel_features_arg_conv.inner = (void*)(channel_features_arg & (~1)); channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27453,14 +32909,37 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_new(int8_tArray pub return ret_ref; } +static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RouteHop_clone_ptr(uint32_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHop_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RouteHop_clone(uint32_t orig) { LDKRouteHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHop ret_var = RouteHop_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27472,6 +32951,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHop_hash(uint32_t o) { LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHop_hash(&o_conv); return ret_val; } @@ -27480,9 +32960,11 @@ jboolean __attribute__((visibility("default"))) TS_RouteHop_eq(uint32_t a, uint LDKRouteHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHop_eq(&a_conv, &b_conv); return ret_val; } @@ -27491,6 +32973,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHop_write(uint32_t o LDKRouteHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27511,6 +32994,7 @@ void __attribute__((visibility("default"))) TS_Route_free(uint32_t this_obj) { LDKRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Route_free(this_obj_conv); } @@ -27518,6 +33002,7 @@ ptrArray __attribute__((visibility("default"))) TS_Route_get_paths(uint32_t thi LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv); ptrArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes"); @@ -27532,6 +33017,7 @@ ptrArray __attribute__((visibility("default"))) TS_Route_get_paths(uint32_t thi uint64_t ret_conv_12_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var); ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner; if (ret_conv_12_conv_10_var.is_owned) { ret_conv_12_conv_10_ref |= 1; @@ -27551,6 +33037,7 @@ void __attribute__((visibility("default"))) TS_Route_set_paths(uint32_t this_pt LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -27572,6 +33059,7 @@ void __attribute__((visibility("default"))) TS_Route_set_paths(uint32_t this_pt LDKRouteHop val_conv_12_conv_10_conv; val_conv_12_conv_10_conv.inner = (void*)(val_conv_12_conv_10 & (~1)); val_conv_12_conv_10_conv.is_owned = (val_conv_12_conv_10 & 1) || (val_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv); val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv); val_conv_12_constr.data[k] = val_conv_12_conv_10_conv; } @@ -27584,11 +33072,13 @@ uint32_t __attribute__((visibility("default"))) TS_Route_get_payee(uint32_t thi LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = Route_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27601,9 +33091,11 @@ void __attribute__((visibility("default"))) TS_Route_set_payee(uint32_t this_pt LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); Route_set_payee(&this_ptr_conv, val_conv); } @@ -27630,6 +33122,7 @@ uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg LDKRouteHop paths_arg_conv_12_conv_10_conv; paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1)); paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv; } @@ -27638,11 +33131,13 @@ uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRoute ret_var = Route_new(paths_arg_constr, payee_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27650,14 +33145,37 @@ uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg return ret_ref; } +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Route_clone_ptr(uint32_t arg) { + LDKRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Route_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Route_clone(uint32_t orig) { LDKRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoute ret_var = Route_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27669,6 +33187,7 @@ int64_t __attribute__((visibility("default"))) TS_Route_hash(uint32_t o) { LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Route_hash(&o_conv); return ret_val; } @@ -27677,9 +33196,11 @@ jboolean __attribute__((visibility("default"))) TS_Route_eq(uint32_t a, uint32_ LDKRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Route_eq(&a_conv, &b_conv); return ret_val; } @@ -27688,6 +33209,7 @@ int64_t __attribute__((visibility("default"))) TS_Route_get_total_fees(uint32_t LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_fees(&this_arg_conv); return ret_val; } @@ -27696,6 +33218,7 @@ int64_t __attribute__((visibility("default"))) TS_Route_get_total_amount(uint32 LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_amount(&this_arg_conv); return ret_val; } @@ -27704,6 +33227,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Route_write(uint32_t obj) LDKRoute obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Route_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27724,6 +33248,7 @@ void __attribute__((visibility("default"))) TS_RouteParameters_free(uint32_t th LDKRouteParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteParameters_free(this_obj_conv); } @@ -27731,10 +33256,12 @@ uint32_t __attribute__((visibility("default"))) TS_RouteParameters_get_payee(ui LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27746,9 +33273,11 @@ void __attribute__((visibility("default"))) TS_RouteParameters_set_payee(uint32 LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); RouteParameters_set_payee(&this_ptr_conv, val_conv); } @@ -27757,6 +33286,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteParameters_get_final_val LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_val; } @@ -27765,6 +33295,7 @@ void __attribute__((visibility("default"))) TS_RouteParameters_set_final_value_ LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_value_msat(&this_ptr_conv, val); } @@ -27772,6 +33303,7 @@ int32_t __attribute__((visibility("default"))) TS_RouteParameters_get_final_clt LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -27780,6 +33312,7 @@ void __attribute__((visibility("default"))) TS_RouteParameters_set_final_cltv_e LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val); } @@ -27787,11 +33320,13 @@ uint32_t __attribute__((visibility("default"))) TS_RouteParameters_new(uint32_t LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27799,14 +33334,37 @@ uint32_t __attribute__((visibility("default"))) TS_RouteParameters_new(uint32_t return ret_ref; } +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RouteParameters_clone_ptr(uint32_t arg) { + LDKRouteParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteParameters_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RouteParameters_clone(uint32_t orig) { LDKRouteParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27818,6 +33376,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteParameters_write(uin LDKRouteParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27838,6 +33397,7 @@ void __attribute__((visibility("default"))) TS_Payee_free(uint32_t this_obj) { LDKPayee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Payee_free(this_obj_conv); } @@ -27845,6 +33405,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Payee_get_pubkey(uint32_t LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), Payee_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -27854,6 +33415,7 @@ void __attribute__((visibility("default"))) TS_Payee_set_pubkey(uint32_t this_p LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -27864,11 +33426,13 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_get_features(uint32_t LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures ret_var = Payee_get_features(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27881,9 +33445,11 @@ void __attribute__((visibility("default"))) TS_Payee_set_features(uint32_t this LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InvoiceFeatures_clone(&val_conv); Payee_set_features(&this_ptr_conv, val_conv); } @@ -27892,6 +33458,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Payee_get_route_hints(u LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -27901,6 +33468,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Payee_get_route_hints(u uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -27916,6 +33484,7 @@ void __attribute__((visibility("default"))) TS_Payee_set_route_hints(uint32_t t LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -27928,6 +33497,7 @@ void __attribute__((visibility("default"))) TS_Payee_set_route_hints(uint32_t t LDKRouteHint val_conv_11_conv; val_conv_11_conv.inner = (void*)(val_conv_11 & (~1)); val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv); val_conv_11_conv = RouteHint_clone(&val_conv_11_conv); val_constr.data[l] = val_conv_11_conv; } @@ -27938,6 +33508,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_get_expiry_time(uint32 LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Payee_get_expiry_time(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -27948,6 +33519,7 @@ void __attribute__((visibility("default"))) TS_Payee_set_expiry_time(uint32_t t LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -27962,6 +33534,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey LDKInvoiceFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InvoiceFeatures_clone(&features_arg_conv); LDKCVec_RouteHintZ route_hints_arg_constr; route_hints_arg_constr.datalen = *((uint32_t*)route_hints_arg); @@ -27975,6 +33548,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey LDKRouteHint route_hints_arg_conv_11_conv; route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1)); route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv); route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv); route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv; } @@ -27986,6 +33560,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27993,14 +33568,37 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey return ret_ref; } +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee ret_var = Payee_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Payee_clone_ptr(uint32_t arg) { + LDKPayee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Payee_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Payee_clone(uint32_t orig) { LDKPayee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayee ret_var = Payee_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28012,6 +33610,7 @@ int64_t __attribute__((visibility("default"))) TS_Payee_hash(uint32_t o) { LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Payee_hash(&o_conv); return ret_val; } @@ -28020,9 +33619,11 @@ jboolean __attribute__((visibility("default"))) TS_Payee_eq(uint32_t a, uint32_ LDKPayee a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayee b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Payee_eq(&a_conv, &b_conv); return ret_val; } @@ -28031,6 +33632,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Payee_write(uint32_t obj) LDKPayee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Payee_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28055,6 +33657,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_from_node_id(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28070,6 +33673,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_for_keysend(int8_tArra uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28081,6 +33685,7 @@ void __attribute__((visibility("default"))) TS_RouteHint_free(uint32_t this_obj LDKRouteHint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHint_free(this_obj_conv); } @@ -28088,6 +33693,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RouteHint_get_a(uint32_ LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -28097,6 +33703,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RouteHint_get_a(uint32_ uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -28112,6 +33719,7 @@ void __attribute__((visibility("default"))) TS_RouteHint_set_a(uint32_t this_pt LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -28124,6 +33732,7 @@ void __attribute__((visibility("default"))) TS_RouteHint_set_a(uint32_t this_pt LDKRouteHintHop val_conv_14_conv; val_conv_14_conv.inner = (void*)(val_conv_14 & (~1)); val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); val_constr.data[o] = val_conv_14_conv; } @@ -28143,6 +33752,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(uint32_tArray LDKRouteHintHop a_arg_conv_14_conv; a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1)); a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); a_arg_constr.data[o] = a_arg_conv_14_conv; } @@ -28150,6 +33760,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(uint32_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28157,14 +33768,37 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(uint32_tArray return ret_ref; } +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RouteHint_clone_ptr(uint32_t arg) { + LDKRouteHint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHint_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RouteHint_clone(uint32_t orig) { LDKRouteHint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHint ret_var = RouteHint_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28176,6 +33810,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHint_hash(uint32_t o) { LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHint_hash(&o_conv); return ret_val; } @@ -28184,9 +33819,11 @@ jboolean __attribute__((visibility("default"))) TS_RouteHint_eq(uint32_t a, uin LDKRouteHint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHint_eq(&a_conv, &b_conv); return ret_val; } @@ -28195,6 +33832,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHint_write(uint32_t LDKRouteHint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28215,6 +33853,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_free(uint32_t this_ LDKRouteHintHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHintHop_free(this_obj_conv); } @@ -28222,6 +33861,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHintHop_get_src_node LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -28231,6 +33871,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_src_node_id(uin LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -28241,6 +33882,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHintHop_get_short_channe LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHintHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -28249,6 +33891,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_short_channel_i LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_short_channel_id(&this_ptr_conv, val); } @@ -28256,10 +33899,12 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_get_fees(uint32 LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28271,9 +33916,11 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_fees(uint32_t t LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); RouteHintHop_set_fees(&this_ptr_conv, val_conv); } @@ -28282,6 +33929,7 @@ int16_t __attribute__((visibility("default"))) TS_RouteHintHop_get_cltv_expiry_ LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -28290,6 +33938,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_cltv_expiry_del LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -28297,6 +33946,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_get_htlc_minimu LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -28307,6 +33957,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_htlc_minimum_ms LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -28318,6 +33969,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_get_htlc_maximu LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -28328,6 +33980,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_htlc_maximum_ms LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -28342,6 +33995,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_new(int8_tArray LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1); CHECK_ACCESS(htlc_minimum_msat_arg_ptr); @@ -28355,6 +34009,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28362,14 +34017,37 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_new(int8_tArray return ret_ref; } +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RouteHintHop_clone_ptr(uint32_t arg) { + LDKRouteHintHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHintHop_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_clone(uint32_t orig) { LDKRouteHintHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28381,6 +34059,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHintHop_hash(uint32_t o) LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHintHop_hash(&o_conv); return ret_val; } @@ -28389,9 +34068,11 @@ jboolean __attribute__((visibility("default"))) TS_RouteHintHop_eq(uint32_t a, LDKRouteHintHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHintHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHintHop_eq(&a_conv, &b_conv); return ret_val; } @@ -28400,6 +34081,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHintHop_write(uint32 LDKRouteHintHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28423,9 +34105,11 @@ uint32_t __attribute__((visibility("default"))) TS_find_route(int8_tArray our_n LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKNetworkGraph network_conv; network_conv.inner = (void*)(network & (~1)); network_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != 0) { @@ -28440,6 +34124,7 @@ uint32_t __attribute__((visibility("default"))) TS_find_route(int8_tArray our_n LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } first_hops_ptr = &first_hops_constr; @@ -28460,6 +34145,7 @@ void __attribute__((visibility("default"))) TS_Scorer_free(uint32_t this_obj) { LDKScorer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Scorer_free(this_obj_conv); } @@ -28467,6 +34153,7 @@ void __attribute__((visibility("default"))) TS_ScoringParameters_free(uint32_t LDKScoringParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ScoringParameters_free(this_obj_conv); } @@ -28474,6 +34161,7 @@ int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_base_pe LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv); return ret_val; } @@ -28482,6 +34170,7 @@ void __attribute__((visibility("default"))) TS_ScoringParameters_set_base_penal LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val); } @@ -28489,6 +34178,7 @@ int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_failure LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv); return ret_val; } @@ -28497,6 +34187,7 @@ void __attribute__((visibility("default"))) TS_ScoringParameters_set_failure_pe LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val); } @@ -28504,6 +34195,7 @@ int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_failure LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv); return ret_val; } @@ -28512,6 +34204,7 @@ void __attribute__((visibility("default"))) TS_ScoringParameters_set_failure_pe LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val); } @@ -28520,6 +34213,7 @@ uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_new(int64_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28531,6 +34225,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ScoringParameters_write(u LDKScoringParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28551,11 +34246,13 @@ uint32_t __attribute__((visibility("default"))) TS_Scorer_new(uint32_t params) LDKScoringParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKScorer ret_var = Scorer_new(params_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28568,6 +34265,7 @@ uint32_t __attribute__((visibility("default"))) TS_Scorer_default() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28580,6 +34278,7 @@ uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_default() uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28591,6 +34290,7 @@ uint32_t __attribute__((visibility("default"))) TS_Scorer_as_Score(uint32_t thi LDKScorer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); *ret_ret = Scorer_as_Score(&this_arg_conv); return (uint64_t)ret_ret; @@ -28600,6 +34300,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Scorer_write(uint32_t obj LDKScorer obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Scorer_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28620,6 +34321,7 @@ void __attribute__((visibility("default"))) TS_FilesystemPersister_free(uint32_ LDKFilesystemPersister this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FilesystemPersister_free(this_obj_conv); } @@ -28629,6 +34331,7 @@ uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_new(jstr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28640,6 +34343,7 @@ jstring __attribute__((visibility("default"))) TS_FilesystemPersister_get_data_ LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -28651,6 +34355,7 @@ uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_persist_ LDKChannelManager manager_conv; manager_conv.inner = (void*)(manager & (~1)); manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = FilesystemPersister_persist_manager(data_dir_conv, &manager_conv); return (uint64_t)ret_conv; @@ -28660,6 +34365,7 @@ uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_read_cha LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -28672,6 +34378,7 @@ uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_as_Persi LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); *ret_ret = FilesystemPersister_as_Persist(&this_arg_conv); return (uint64_t)ret_ret; @@ -28681,6 +34388,7 @@ void __attribute__((visibility("default"))) TS_BackgroundProcessor_free(uint32_ LDKBackgroundProcessor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BackgroundProcessor_free(this_obj_conv); } @@ -28703,15 +34411,19 @@ uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_start(ui LDKChainMonitor chain_monitor_conv; chain_monitor_conv.inner = (void*)(chain_monitor & (~1)); chain_monitor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv); LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKNetGraphMsgHandler net_graph_msg_handler_conv; net_graph_msg_handler_conv.inner = (void*)(net_graph_msg_handler & (~1)); net_graph_msg_handler_conv.is_owned = (net_graph_msg_handler & 1) || (net_graph_msg_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(net_graph_msg_handler_conv); LDKPeerManager peer_manager_conv; peer_manager_conv.inner = (void*)(peer_manager & (~1)); peer_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -28719,6 +34431,7 @@ uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_start(ui uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28730,6 +34443,7 @@ uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_join(uin LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_join(this_arg_conv); @@ -28740,6 +34454,7 @@ uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_stop(uin LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_stop(this_arg_conv); @@ -28754,6 +34469,7 @@ void __attribute__((visibility("default"))) TS_Invoice_free(uint32_t this_obj) LDKInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Invoice_free(this_obj_conv); } @@ -28761,21 +34477,46 @@ jboolean __attribute__((visibility("default"))) TS_Invoice_eq(uint32_t a, uint3 LDKInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Invoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) { + LDKInvoice ret_var = Invoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Invoice_clone_ptr(uint32_t arg) { + LDKInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Invoice_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Invoice_clone(uint32_t orig) { LDKInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoice ret_var = Invoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28787,6 +34528,7 @@ void __attribute__((visibility("default"))) TS_SignedRawInvoice_free(uint32_t t LDKSignedRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); SignedRawInvoice_free(this_obj_conv); } @@ -28794,21 +34536,46 @@ jboolean __attribute__((visibility("default"))) TS_SignedRawInvoice_eq(uint32_t LDKSignedRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSignedRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = SignedRawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) { + LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_SignedRawInvoice_clone_ptr(uint32_t arg) { + LDKSignedRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = SignedRawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_clone(uint32_t orig) { LDKSignedRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28820,6 +34587,7 @@ void __attribute__((visibility("default"))) TS_RawInvoice_free(uint32_t this_ob LDKRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawInvoice_free(this_obj_conv); } @@ -28827,10 +34595,12 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_get_data(uint32_t LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28842,9 +34612,11 @@ void __attribute__((visibility("default"))) TS_RawInvoice_set_data(uint32_t thi LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RawDataPart_clone(&val_conv); RawInvoice_set_data(&this_ptr_conv, val_conv); } @@ -28853,21 +34625,46 @@ jboolean __attribute__((visibility("default"))) TS_RawInvoice_eq(uint32_t a, ui LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) { + LDKRawInvoice ret_var = RawInvoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RawInvoice_clone_ptr(uint32_t arg) { + LDKRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RawInvoice_clone(uint32_t orig) { LDKRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28879,6 +34676,7 @@ void __attribute__((visibility("default"))) TS_RawDataPart_free(uint32_t this_o LDKRawDataPart this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawDataPart_free(this_obj_conv); } @@ -28886,10 +34684,12 @@ uint32_t __attribute__((visibility("default"))) TS_RawDataPart_get_timestamp(ui LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28901,9 +34701,11 @@ void __attribute__((visibility("default"))) TS_RawDataPart_set_timestamp(uint32 LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = PositiveTimestamp_clone(&val_conv); RawDataPart_set_timestamp(&this_ptr_conv, val_conv); } @@ -28912,21 +34714,46 @@ jboolean __attribute__((visibility("default"))) TS_RawDataPart_eq(uint32_t a, u LDKRawDataPart a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawDataPart b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawDataPart_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) { + LDKRawDataPart ret_var = RawDataPart_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RawDataPart_clone_ptr(uint32_t arg) { + LDKRawDataPart arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawDataPart_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RawDataPart_clone(uint32_t orig) { LDKRawDataPart orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28938,6 +34765,7 @@ void __attribute__((visibility("default"))) TS_PositiveTimestamp_free(uint32_t LDKPositiveTimestamp this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PositiveTimestamp_free(this_obj_conv); } @@ -28945,21 +34773,46 @@ jboolean __attribute__((visibility("default"))) TS_PositiveTimestamp_eq(uint32_ LDKPositiveTimestamp a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPositiveTimestamp b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PositiveTimestamp_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) { + LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PositiveTimestamp_clone_ptr(uint32_t arg) { + LDKPositiveTimestamp arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PositiveTimestamp_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PositiveTimestamp_clone(uint32_t orig) { LDKPositiveTimestamp orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29054,17 +34907,41 @@ void __attribute__((visibility("default"))) TS_Sha256_free(uint32_t this_obj) { LDKSha256 this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Sha256_free(this_obj_conv); } +static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) { + LDKSha256 ret_var = Sha256_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Sha256_clone_ptr(uint32_t arg) { + LDKSha256 arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Sha256_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Sha256_clone(uint32_t orig) { LDKSha256 orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSha256 ret_var = Sha256_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29076,6 +34953,7 @@ int64_t __attribute__((visibility("default"))) TS_Sha256_hash(uint32_t o) { LDKSha256 o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Sha256_hash(&o_conv); return ret_val; } @@ -29084,9 +34962,11 @@ jboolean __attribute__((visibility("default"))) TS_Sha256_eq(uint32_t a, uint32 LDKSha256 a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSha256 b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Sha256_eq(&a_conv, &b_conv); return ret_val; } @@ -29095,17 +34975,41 @@ void __attribute__((visibility("default"))) TS_Description_free(uint32_t this_o LDKDescription this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Description_free(this_obj_conv); } +static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) { + LDKDescription ret_var = Description_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Description_clone_ptr(uint32_t arg) { + LDKDescription arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Description_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Description_clone(uint32_t orig) { LDKDescription orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDescription ret_var = Description_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29117,6 +35021,7 @@ int64_t __attribute__((visibility("default"))) TS_Description_hash(uint32_t o) LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Description_hash(&o_conv); return ret_val; } @@ -29125,9 +35030,11 @@ jboolean __attribute__((visibility("default"))) TS_Description_eq(uint32_t a, u LDKDescription a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKDescription b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Description_eq(&a_conv, &b_conv); return ret_val; } @@ -29136,6 +35043,7 @@ void __attribute__((visibility("default"))) TS_PayeePubKey_free(uint32_t this_o LDKPayeePubKey this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PayeePubKey_free(this_obj_conv); } @@ -29143,6 +35051,7 @@ int8_tArray __attribute__((visibility("default"))) TS_PayeePubKey_get_a(uint32_ LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -29152,6 +35061,7 @@ void __attribute__((visibility("default"))) TS_PayeePubKey_set_a(uint32_t this_ LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -29166,6 +35076,7 @@ uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29173,14 +35084,37 @@ uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_new(int8_tArray return ret_ref; } +static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) { + LDKPayeePubKey ret_var = PayeePubKey_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PayeePubKey_clone_ptr(uint32_t arg) { + LDKPayeePubKey arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PayeePubKey_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_clone(uint32_t orig) { LDKPayeePubKey orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29192,6 +35126,7 @@ int64_t __attribute__((visibility("default"))) TS_PayeePubKey_hash(uint32_t o) LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PayeePubKey_hash(&o_conv); return ret_val; } @@ -29200,9 +35135,11 @@ jboolean __attribute__((visibility("default"))) TS_PayeePubKey_eq(uint32_t a, u LDKPayeePubKey a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayeePubKey b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PayeePubKey_eq(&a_conv, &b_conv); return ret_val; } @@ -29211,17 +35148,41 @@ void __attribute__((visibility("default"))) TS_ExpiryTime_free(uint32_t this_ob LDKExpiryTime this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ExpiryTime_free(this_obj_conv); } +static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) { + LDKExpiryTime ret_var = ExpiryTime_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ExpiryTime_clone_ptr(uint32_t arg) { + LDKExpiryTime arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ExpiryTime_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ExpiryTime_clone(uint32_t orig) { LDKExpiryTime orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29233,6 +35194,7 @@ int64_t __attribute__((visibility("default"))) TS_ExpiryTime_hash(uint32_t o) { LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ExpiryTime_hash(&o_conv); return ret_val; } @@ -29241,9 +35203,11 @@ jboolean __attribute__((visibility("default"))) TS_ExpiryTime_eq(uint32_t a, ui LDKExpiryTime a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKExpiryTime b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ExpiryTime_eq(&a_conv, &b_conv); return ret_val; } @@ -29252,6 +35216,7 @@ void __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_free(uint32_t LDKMinFinalCltvExpiry this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MinFinalCltvExpiry_free(this_obj_conv); } @@ -29259,6 +35224,7 @@ int64_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_get_a(uint LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv); return ret_val; } @@ -29267,6 +35233,7 @@ void __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_set_a(uint32_ LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); MinFinalCltvExpiry_set_a(&this_ptr_conv, val); } @@ -29275,6 +35242,7 @@ uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_new(int64 uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29282,14 +35250,37 @@ uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_new(int64 return ret_ref; } +static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) { + LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_clone_ptr(uint32_t arg) { + LDKMinFinalCltvExpiry arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MinFinalCltvExpiry_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_clone(uint32_t orig) { LDKMinFinalCltvExpiry orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29301,6 +35292,7 @@ int64_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_hash(uint3 LDKMinFinalCltvExpiry o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MinFinalCltvExpiry_hash(&o_conv); return ret_val; } @@ -29309,9 +35301,11 @@ jboolean __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_eq(uint32 LDKMinFinalCltvExpiry a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMinFinalCltvExpiry b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MinFinalCltvExpiry_eq(&a_conv, &b_conv); return ret_val; } @@ -29325,6 +35319,18 @@ void __attribute__((visibility("default"))) TS_Fallback_free(uint32_t this_ptr) Fallback_free(this_ptr_conv); } +static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) { + LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); + *ret_copy = Fallback_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Fallback_clone_ptr(uint32_t arg) { + LDKFallback* arg_conv = (LDKFallback*)arg; + int64_t ret_val = Fallback_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Fallback_clone(uint32_t orig) { LDKFallback* orig_conv = (LDKFallback*)orig; LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); @@ -29382,17 +35388,41 @@ void __attribute__((visibility("default"))) TS_InvoiceSignature_free(uint32_t t LDKInvoiceSignature this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceSignature_free(this_obj_conv); } +static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) { + LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InvoiceSignature_clone_ptr(uint32_t arg) { + LDKInvoiceSignature arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceSignature_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InvoiceSignature_clone(uint32_t orig) { LDKInvoiceSignature orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29404,9 +35434,11 @@ jboolean __attribute__((visibility("default"))) TS_InvoiceSignature_eq(uint32_t LDKInvoiceSignature a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceSignature b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceSignature_eq(&a_conv, &b_conv); return ret_val; } @@ -29415,17 +35447,41 @@ void __attribute__((visibility("default"))) TS_PrivateRoute_free(uint32_t this_ LDKPrivateRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PrivateRoute_free(this_obj_conv); } +static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) { + LDKPrivateRoute ret_var = PrivateRoute_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PrivateRoute_clone_ptr(uint32_t arg) { + LDKPrivateRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PrivateRoute_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PrivateRoute_clone(uint32_t orig) { LDKPrivateRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29437,6 +35493,7 @@ int64_t __attribute__((visibility("default"))) TS_PrivateRoute_hash(uint32_t o) LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PrivateRoute_hash(&o_conv); return ret_val; } @@ -29445,9 +35502,11 @@ jboolean __attribute__((visibility("default"))) TS_PrivateRoute_eq(uint32_t a, LDKPrivateRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPrivateRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PrivateRoute_eq(&a_conv, &b_conv); return ret_val; } @@ -29456,6 +35515,7 @@ uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_into_parts( LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = SignedRawInvoice_clone(&this_arg_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = SignedRawInvoice_into_parts(this_arg_conv); @@ -29466,10 +35526,12 @@ uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_raw_invoice LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29481,6 +35543,7 @@ int8_tArray __attribute__((visibility("default"))) TS_SignedRawInvoice_hash(uin LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *SignedRawInvoice_hash(&this_arg_conv), 32); return ret_arr; @@ -29490,10 +35553,12 @@ uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_signature(u LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29505,6 +35570,7 @@ uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_recover_pay LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv); return (uint64_t)ret_conv; @@ -29514,6 +35580,7 @@ jboolean __attribute__((visibility("default"))) TS_SignedRawInvoice_check_signa LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = SignedRawInvoice_check_signature(&this_arg_conv); return ret_val; } @@ -29522,6 +35589,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RawInvoice_hash(uint32_t LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RawInvoice_hash(&this_arg_conv).data, 32); return ret_arr; @@ -29531,11 +35599,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_payment_hash(uint LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29548,11 +35618,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_description(uint3 LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDescription ret_var = RawInvoice_description(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29565,11 +35637,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_payee_pub_key(uin LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29582,11 +35656,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_description_hash( LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29599,11 +35675,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_expiry_time(uint3 LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29616,11 +35694,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_min_final_cltv_ex LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29633,6 +35713,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RawInvoice_payment_secret LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RawInvoice_payment_secret(&this_arg_conv).data, 32); return ret_arr; @@ -29642,11 +35723,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_features(uint32_t LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29659,6 +35742,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RawInvoice_private_rout LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -29668,6 +35752,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RawInvoice_private_rout uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -29683,6 +35768,7 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_amount_pico_btc(u LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -29693,6 +35779,7 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_currency(uint32_t LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); uint32_t ret_conv = LDKCurrency_to_js(RawInvoice_currency(&this_arg_conv)); return ret_conv; } @@ -29713,6 +35800,7 @@ int64_t __attribute__((visibility("default"))) TS_PositiveTimestamp_as_unix_tim LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_unix_timestamp(&this_arg_conv); return ret_val; } @@ -29721,6 +35809,7 @@ int64_t __attribute__((visibility("default"))) TS_PositiveTimestamp_as_time(uin LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_time(&this_arg_conv); return ret_val; } @@ -29729,11 +35818,13 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_into_signed_raw(uint LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Invoice_clone(&this_arg_conv); LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29745,6 +35836,7 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_check_signature(uint LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); *ret_conv = Invoice_check_signature(&this_arg_conv); return (uint64_t)ret_conv; @@ -29754,6 +35846,7 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_from_signed(uint32_t LDKSignedRawInvoice signed_invoice_conv; signed_invoice_conv.inner = (void*)(signed_invoice & (~1)); signed_invoice_conv.is_owned = (signed_invoice & 1) || (signed_invoice == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv); signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = Invoice_from_signed(signed_invoice_conv); @@ -29764,6 +35857,7 @@ int64_t __attribute__((visibility("default"))) TS_Invoice_timestamp(uint32_t th LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_timestamp(&this_arg_conv); return ret_val; } @@ -29772,6 +35866,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Invoice_payment_hash(uint LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *Invoice_payment_hash(&this_arg_conv), 32); return ret_arr; @@ -29781,6 +35876,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Invoice_payee_pub_key(uin LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), Invoice_payee_pub_key(&this_arg_conv).compressed_form, 33); return ret_arr; @@ -29790,6 +35886,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Invoice_payment_secret(ui LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *Invoice_payment_secret(&this_arg_conv), 32); return ret_arr; @@ -29799,11 +35896,13 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_features(uint32_t th LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29816,6 +35915,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Invoice_recover_payee_pub LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form, 33); return ret_arr; @@ -29825,6 +35925,7 @@ int64_t __attribute__((visibility("default"))) TS_Invoice_expiry_time(uint32_t LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_expiry_time(&this_arg_conv); return ret_val; } @@ -29833,6 +35934,7 @@ jboolean __attribute__((visibility("default"))) TS_Invoice_is_expired(uint32_t LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = Invoice_is_expired(&this_arg_conv); return ret_val; } @@ -29841,6 +35943,7 @@ int64_t __attribute__((visibility("default"))) TS_Invoice_min_final_cltv_expiry LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_min_final_cltv_expiry(&this_arg_conv); return ret_val; } @@ -29849,6 +35952,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Invoice_private_routes( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -29858,6 +35962,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Invoice_private_routes( uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -29873,6 +35978,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Invoice_route_hints(uin LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -29882,6 +35988,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Invoice_route_hints(uin uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -29897,6 +36004,7 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_currency(uint32_t th LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); uint32_t ret_conv = LDKCurrency_to_js(Invoice_currency(&this_arg_conv)); return ret_conv; } @@ -29905,6 +36013,7 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_amount_milli_satoshi LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -29922,6 +36031,7 @@ jstring __attribute__((visibility("default"))) TS_Description_into_inner(uint32 LDKDescription this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Description_clone(&this_arg_conv); LDKStr ret_str = Description_into_inner(this_arg_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); @@ -29945,6 +36055,7 @@ int64_t __attribute__((visibility("default"))) TS_ExpiryTime_as_seconds(uint32_ LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_seconds(&this_arg_conv); return ret_val; } @@ -29953,6 +36064,7 @@ int64_t __attribute__((visibility("default"))) TS_ExpiryTime_as_duration(uint32 LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_duration(&this_arg_conv); return ret_val; } @@ -29961,6 +36073,7 @@ uint32_t __attribute__((visibility("default"))) TS_PrivateRoute_new(uint32_t ho LDKRouteHint hops_conv; hops_conv.inner = (void*)(hops & (~1)); hops_conv.is_owned = (hops & 1) || (hops == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv); hops_conv = RouteHint_clone(&hops_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = PrivateRoute_new(hops_conv); @@ -29971,11 +36084,13 @@ uint32_t __attribute__((visibility("default"))) TS_PrivateRoute_into_inner(uint LDKPrivateRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = PrivateRoute_clone(&this_arg_conv); LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30104,6 +36219,18 @@ void __attribute__((visibility("default"))) TS_SignOrCreationError_free(uint32_ SignOrCreationError_free(this_ptr_conv); } +static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) { + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = SignOrCreationError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_SignOrCreationError_clone_ptr(uint32_t arg) { + LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)arg; + int64_t ret_val = SignOrCreationError_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_SignOrCreationError_clone(uint32_t orig) { LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)orig; LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); @@ -30146,6 +36273,7 @@ void __attribute__((visibility("default"))) TS_InvoicePayer_free(uint32_t this_ LDKInvoicePayer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoicePayer_free(this_obj_conv); } @@ -30171,6 +36299,7 @@ void __attribute__((visibility("default"))) TS_RetryAttempts_free(uint32_t this LDKRetryAttempts this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RetryAttempts_free(this_obj_conv); } @@ -30178,6 +36307,7 @@ int64_t __attribute__((visibility("default"))) TS_RetryAttempts_get_a(uint32_t LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv); return ret_val; } @@ -30186,6 +36316,7 @@ void __attribute__((visibility("default"))) TS_RetryAttempts_set_a(uint32_t thi LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RetryAttempts_set_a(&this_ptr_conv, val); } @@ -30194,6 +36325,7 @@ uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_new(int64_t a_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30201,14 +36333,37 @@ uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_new(int64_t a_ return ret_ref; } +static inline uint64_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg) { + LDKRetryAttempts ret_var = RetryAttempts_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RetryAttempts_clone_ptr(uint32_t arg) { + LDKRetryAttempts arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RetryAttempts_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_clone(uint32_t orig) { LDKRetryAttempts orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRetryAttempts ret_var = RetryAttempts_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30220,9 +36375,11 @@ jboolean __attribute__((visibility("default"))) TS_RetryAttempts_eq(uint32_t a, LDKRetryAttempts a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRetryAttempts b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv); return ret_val; } @@ -30231,6 +36388,7 @@ int64_t __attribute__((visibility("default"))) TS_RetryAttempts_hash(uint32_t o LDKRetryAttempts o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RetryAttempts_hash(&o_conv); return ret_val; } @@ -30244,6 +36402,18 @@ void __attribute__((visibility("default"))) TS_PaymentError_free(uint32_t this_ PaymentError_free(this_ptr_conv); } +static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) { + LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); + *ret_copy = PaymentError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PaymentError_clone_ptr(uint32_t arg) { + LDKPaymentError* arg_conv = (LDKPaymentError*)arg; + int64_t ret_val = PaymentError_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PaymentError_clone(uint32_t orig) { LDKPaymentError* orig_conv = (LDKPaymentError*)orig; LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); @@ -30264,6 +36434,7 @@ uint32_t __attribute__((visibility("default"))) TS_PaymentError_routing(uint32_ LDKLightningError a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = LightningError_clone(&a_conv); LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); *ret_copy = PaymentError_routing(a_conv); @@ -30292,6 +36463,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_new(uint32_t pa LDKLockableScore scorer_conv; scorer_conv.inner = (void*)(scorer & (~1)); scorer_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -30301,11 +36473,13 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_new(uint32_t pa LDKRetryAttempts retry_attempts_conv; retry_attempts_conv.inner = (void*)(retry_attempts & (~1)); retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_attempts_conv); retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv); LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30317,9 +36491,11 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_invoice(uin LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv); return (uint64_t)ret_conv; @@ -30329,9 +36505,11 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_zero_value_ LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats); return (uint64_t)ret_conv; @@ -30341,6 +36519,7 @@ void __attribute__((visibility("default"))) TS_InvoicePayer_remove_cached_payme LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_arr, (uint8_t*)(payment_hash + 4), 32); @@ -30352,6 +36531,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_as_EventHandler LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -30361,6 +36541,7 @@ uint32_t __attribute__((visibility("default"))) TS_create_invoice_from_channelm LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -30379,6 +36560,7 @@ void __attribute__((visibility("default"))) TS_DefaultRouter_free(uint32_t this LDKDefaultRouter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DefaultRouter_free(this_obj_conv); } @@ -30386,6 +36568,7 @@ uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_new(uint32_t n LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -30393,6 +36576,7 @@ uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_new(uint32_t n uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30404,6 +36588,7 @@ uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_as_Router(uint LDKDefaultRouter this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); *ret_ret = DefaultRouter_as_Router(&this_arg_conv); return (uint64_t)ret_ret; @@ -30413,6 +36598,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Payer(uint LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer"); *ret_ret = ChannelManager_as_Payer(&this_arg_conv); return (uint64_t)ret_ret; @@ -30443,6 +36629,7 @@ jstring __attribute__((visibility("default"))) TS_Invoice_to_str(uint32_t o) { LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = Invoice_to_str(&o_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -30453,6 +36640,7 @@ jstring __attribute__((visibility("default"))) TS_SignedRawInvoice_to_str(uint3 LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = SignedRawInvoice_to_str(&o_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); diff --git a/ts/bindings.c.body b/ts/bindings.c.body index b9a8cdc6..27e39255 100644 --- a/ts/bindings.c.body +++ b/ts/bindings.c.body @@ -20,6 +20,7 @@ void free(void *ptr); #define DO_ASSERT(a) (void)(a) #define CHECK(a) #define CHECK_ACCESS(p) +#define CHECK_INNER_FIELD_ACCESS_OR_NULL(v) // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed) _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec and [u8] need to have been mapped identically"); @@ -310,20 +311,6 @@ static inline int32_t LDKSiPrefix_to_js(LDKSiPrefix val) { default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_u8Z_new(int8_tArray elems) { - LDKCVec_u8Z *ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVec_u8Z Data"); - int8_t *java_elems = (int8_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - } - return (uint64_t)ret; -} static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen); @@ -344,9 +331,6 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}int64_t return ret_val; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_get_ok(uint32_t arg) { LDKCResult_SecretKeyErrorZ *val = (LDKCResult_SecretKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -360,9 +344,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_g uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PublicKeyErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PublicKeyErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PublicKeyErrorZ_get_ok(uint32_t arg) { LDKCResult_PublicKeyErrorZ *val = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -376,9 +357,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PublicKeyErrorZ_g uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_TxCreationKeysDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -386,6 +364,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -396,12 +375,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelPublicKeysDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -409,6 +386,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeys uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -419,12 +397,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeys uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_TxCreationKeysErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErrorZ_get_ok(uint32_t arg) { LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -432,6 +408,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -453,9 +430,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u32Z_ref_from_ptr( default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -463,6 +437,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommi uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -473,12 +448,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommi uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -486,6 +459,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChann uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -496,12 +470,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChann uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -509,6 +481,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactio uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -519,12 +492,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactio uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -532,6 +503,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentT uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -542,12 +514,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentT uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -555,6 +525,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -565,12 +536,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransactionNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_TrustedClosingTransactionNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransactionNoneZ_get_ok(uint32_t arg) { LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -578,6 +547,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTra uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -586,9 +556,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransac CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -596,6 +563,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransac uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -606,12 +574,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransac uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_TrustedCommitmentTransactionNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(uint32_t arg) { LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -619,6 +585,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitment uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -627,9 +594,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTran CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok; -} ptrArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_get_ok(uint32_t arg) { LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -650,9 +614,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_ CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ShutdownScriptDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -660,6 +621,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -670,12 +632,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(uint32_t arg) { - return ((LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint32_t arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); CHECK(val->result_ok); @@ -683,6 +643,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInv uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -693,12 +654,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInv uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneErrorZ *val = (LDKCResult_NoneErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -710,9 +669,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_get_er uint32_t err_conv = LDKIOError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteHopDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -720,6 +676,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -730,28 +687,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHopZ_new(uint32_tArray elems) { - LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVec_RouteHopZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKRouteHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -766,9 +705,6 @@ static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_C } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -776,6 +712,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -786,12 +723,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -799,6 +734,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -809,28 +745,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintZ_new(uint32_tArray elems) { - LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKRouteHint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -850,9 +768,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u64Z_ref_from_ptr( default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -860,6 +775,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -870,28 +786,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintHopZ_new(uint32_tArray elems) { - LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKRouteHintHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHintHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -899,9 +797,6 @@ static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_Route } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -909,6 +804,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeEr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -919,12 +815,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -932,6 +826,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -942,28 +837,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelDetailsZ_new(uint32_tArray elems) { - LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKChannelDetails arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelDetails_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -971,9 +848,6 @@ static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_C } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErrorZ_get_ok(uint32_t arg) { LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -981,6 +855,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -991,12 +866,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxOutAccessErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxOutAccessErrorZ_get_ok(uint32_t arg) { LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1030,25 +903,6 @@ int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ return ret_arr; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_usizeTransactionZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_usizeTransactionZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "LDKCVec_C2Tuple_usizeTransactionZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * ret->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1063,9 +917,6 @@ static inline LDKCVec_TxidZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_TxidZ *orig } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(uint32_t arg) { LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); CHECK(val->result_ok); @@ -1085,6 +936,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr( uint64_t htlc_event_ref = 0; CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1; return 0 /* LDKMonitorEvent - HTLCEvent */; (void) htlc_event_ref; } @@ -1093,6 +945,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr( uint64_t commitment_tx_confirmed_ref = 0; CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1; return 0 /* LDKMonitorEvent - CommitmentTxConfirmed */; (void) commitment_tx_confirmed_ref; } @@ -1101,6 +954,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr( uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1; return 0 /* LDKMonitorEvent - UpdateCompleted */; (void) funding_txo_ref; (void) obj->update_completed.monitor_update_id; } @@ -1109,31 +963,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr( uint64_t update_failed_ref = 0; CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); update_failed_ref = (uint64_t)update_failed_var.inner & ~1; return 0 /* LDKMonitorEvent - UpdateFailed */; (void) update_failed_ref; } default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_MonitorEventZ_new(uint32_tArray elems) { - LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVec_MonitorEventZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr); - arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1156,6 +992,67 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_C2Tuple_usizeTrans default: abort(); } } +uint32_t __attribute__((visibility("default"))) TS_LDKClosureReason_ref_from_ptr(uint32_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); + switch(obj->tag) { + case LDKClosureReason_CounterpartyForceClosed: { + LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; + jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len); + return 0 /* LDKClosureReason - CounterpartyForceClosed */; (void) peer_msg_conv; + } + case LDKClosureReason_HolderForceClosed: { + return 0 /* LDKClosureReason - HolderForceClosed */; + } + case LDKClosureReason_CooperativeClosure: { + return 0 /* LDKClosureReason - CooperativeClosure */; + } + case LDKClosureReason_CommitmentTxConfirmed: { + return 0 /* LDKClosureReason - CommitmentTxConfirmed */; + } + case LDKClosureReason_ProcessingError: { + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len); + return 0 /* LDKClosureReason - ProcessingError */; (void) err_conv; + } + case LDKClosureReason_DisconnectedPeer: { + return 0 /* LDKClosureReason - DisconnectedPeer */; + } + case LDKClosureReason_OutdatedChannelManager: { + return 0 /* LDKClosureReason - OutdatedChannelManager */; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_ClosureReasonZ_ref_from_ptr(uint32_t ptr) { + LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_ClosureReasonZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return 0 /* LDKCOption_ClosureReasonZ - Some */; (void) some_ref; + } + case LDKCOption_ClosureReasonZ_None: { + return 0 /* LDKCOption_ClosureReasonZ - None */; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_ok(uint32_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint32_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} uint32_t __attribute__((visibility("default"))) TS_LDKNetworkUpdate_ref_from_ptr(uint32_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)(ptr & ~1); switch(obj->tag) { @@ -1164,6 +1061,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKNetworkUpdate_ref_from_ptr uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKNetworkUpdate - ChannelUpdateMessage */; (void) msg_ref; } @@ -1199,6 +1097,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ uint64_t outpoint_ref = 0; CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); outpoint_ref = (uint64_t)outpoint_var.inner & ~1; uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1; return 0 /* LDKSpendableOutputDescriptor - StaticOutput */; (void) outpoint_ref; (void) (uint64_t)output_ref; @@ -1208,6 +1107,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ uint64_t delayed_payment_output_ref = 0; CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var); delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1; return 0 /* LDKSpendableOutputDescriptor - DelayedPaymentOutput */; (void) delayed_payment_output_ref; } @@ -1216,31 +1116,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ uint64_t static_payment_output_ref = 0; CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var); static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1; return 0 /* LDKSpendableOutputDescriptor - StaticPaymentOutput */; (void) static_payment_output_ref; } default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_SpendableOutputDescriptorZ_new(uint32_tArray elems) { - LDKCVec_SpendableOutputDescriptorZ *ret = MALLOC(sizeof(LDKCVec_SpendableOutputDescriptorZ), "LDKCVec_SpendableOutputDescriptorZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVec_SpendableOutputDescriptorZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr); - arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) { LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1248,6 +1130,148 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } return ret; } +uint32_t __attribute__((visibility("default"))) TS_LDKPaymentPurpose_ref_from_ptr(uint32_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); + switch(obj->tag) { + case LDKPaymentPurpose_InvoicePayment: { + int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_preimage_arr + 4), obj->invoice_payment.payment_preimage.data, 32); + int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_secret_arr + 4), obj->invoice_payment.payment_secret.data, 32); + return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr; (void) obj->invoice_payment.user_payment_id; + } + case LDKPaymentPurpose_SpontaneousPayment: { + int8_tArray spontaneous_payment_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(spontaneous_payment_arr + 4), obj->spontaneous_payment.data, 32); + return 0 /* LDKPaymentPurpose - SpontaneousPayment */; (void) spontaneous_payment_arr; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKEvent_ref_from_ptr(uint32_t ptr) { + LDKEvent *obj = (LDKEvent*)(ptr & ~1); + switch(obj->tag) { + case LDKEvent_FundingGenerationReady: { + int8_tArray temporary_channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(temporary_channel_id_arr + 4), obj->funding_generation_ready.temporary_channel_id.data, 32); + LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; + int8_tArray output_script_arr = init_arr(output_script_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(output_script_arr + 4), output_script_var.data, output_script_var.datalen); + return 0 /* LDKEvent - FundingGenerationReady */; (void) temporary_channel_id_arr; (void) obj->funding_generation_ready.channel_value_satoshis; (void) output_script_arr; (void) obj->funding_generation_ready.user_channel_id; + } + case LDKEvent_PaymentReceived: { + int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_received.payment_hash.data, 32); + uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; + return 0 /* LDKEvent - PaymentReceived */; (void) payment_hash_arr; (void) obj->payment_received.amt; (void) purpose_ref; + } + case LDKEvent_PaymentSent: { + int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_sent.payment_id.data, 32); + int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_preimage_arr + 4), obj->payment_sent.payment_preimage.data, 32); + int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_sent.payment_hash.data, 32); + uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; + return 0 /* LDKEvent - PaymentSent */; (void) payment_id_arr; (void) payment_preimage_arr; (void) payment_hash_arr; (void) fee_paid_msat_ref; + } + case LDKEvent_PaymentPathFailed: { + int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_path_failed.payment_id.data, 32); + int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_path_failed.payment_hash.data, 32); + uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; + LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; + uint32_tArray path_arr = NULL; + path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *path_arr_ptr = (uint32_t*)(path_arr + 4); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + uint64_t path_conv_10_ref = 0; + CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_arr_ptr[k] = path_conv_10_ref; + } + + uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; + LDKRouteParameters retry_var = obj->payment_path_failed.retry; + uint64_t retry_ref = 0; + if ((uint64_t)retry_var.inner > 4096) { + CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var); + retry_ref = (uint64_t)retry_var.inner & ~1; + } + return 0 /* LDKEvent - PaymentPathFailed */; (void) payment_id_arr; (void) payment_hash_arr; (void) obj->payment_path_failed.rejected_by_dest; (void) network_update_ref; (void) obj->payment_path_failed.all_paths_failed; (void) path_arr; (void) short_channel_id_ref; (void) retry_ref; + } + case LDKEvent_PendingHTLCsForwardable: { + return 0 /* LDKEvent - PendingHTLCsForwardable */; (void) obj->pending_htl_cs_forwardable.time_forwardable; + } + case LDKEvent_SpendableOutputs: { + LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; + uint32_tArray outputs_arr = NULL; + outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); + uint32_t *outputs_arr_ptr = (uint32_t*)(outputs_arr + 4); + for (size_t b = 0; b < outputs_var.datalen; b++) { + uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; + outputs_arr_ptr[b] = outputs_conv_27_ref; + } + + return 0 /* LDKEvent - SpendableOutputs */; (void) outputs_arr; + } + case LDKEvent_PaymentForwarded: { + uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; + return 0 /* LDKEvent - PaymentForwarded */; (void) fee_earned_msat_ref; (void) obj->payment_forwarded.claim_from_onchain_tx; + } + case LDKEvent_ChannelClosed: { + int8_tArray channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(channel_id_arr + 4), obj->channel_closed.channel_id.data, 32); + uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; + return 0 /* LDKEvent - ChannelClosed */; (void) channel_id_arr; (void) obj->channel_closed.user_channel_id; (void) reason_ref; + } + case LDKEvent_DiscardFunding: { + int8_tArray channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(channel_id_arr + 4), obj->discard_funding.channel_id.data, 32); + LDKTransaction transaction_var = obj->discard_funding.transaction; + int8_tArray transaction_arr = init_arr(transaction_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); + memcpy((uint8_t*)(transaction_arr + 4), transaction_var.data, transaction_var.datalen); + return 0 /* LDKEvent - DiscardFunding */; (void) channel_id_arr; (void) transaction_arr; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_EventZ_ref_from_ptr(uint32_t ptr) { + LDKCOption_EventZ *obj = (LDKCOption_EventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_EventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return 0 /* LDKCOption_EventZ - Some */; (void) some_ref; + } + case LDKCOption_EventZ_None: { + return 0 /* LDKCOption_EventZ - None */; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_EventZDecodeErrorZ_get_ok(uint32_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_EventZDecodeErrorZ_get_err(uint32_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(uint32_t ptr) { LDKErrorAction *obj = (LDKErrorAction*)(ptr & ~1); switch(obj->tag) { @@ -1257,6 +1281,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(u if ((uint64_t)msg_var.inner > 4096) { CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; } return 0 /* LDKErrorAction - DisconnectPeer */; (void) msg_ref; @@ -1273,6 +1298,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(u uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKErrorAction - SendErrorMessage */; (void) msg_ref; } @@ -1289,6 +1315,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendAcceptChannel */; (void) node_id_arr; (void) msg_ref; } @@ -1299,6 +1326,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendOpenChannel */; (void) node_id_arr; (void) msg_ref; } @@ -1309,6 +1337,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendFundingCreated */; (void) node_id_arr; (void) msg_ref; } @@ -1319,6 +1348,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendFundingSigned */; (void) node_id_arr; (void) msg_ref; } @@ -1329,6 +1359,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendFundingLocked */; (void) node_id_arr; (void) msg_ref; } @@ -1339,6 +1370,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendAnnouncementSignatures */; (void) node_id_arr; (void) msg_ref; } @@ -1349,6 +1381,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t updates_ref = 0; CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var); updates_ref = (uint64_t)updates_var.inner & ~1; return 0 /* LDKMessageSendEvent - UpdateHTLCs */; (void) node_id_arr; (void) updates_ref; } @@ -1359,6 +1392,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendRevokeAndACK */; (void) node_id_arr; (void) msg_ref; } @@ -1369,6 +1403,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendClosingSigned */; (void) node_id_arr; (void) msg_ref; } @@ -1379,6 +1414,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendShutdown */; (void) node_id_arr; (void) msg_ref; } @@ -1389,6 +1425,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendChannelReestablish */; (void) node_id_arr; (void) msg_ref; } @@ -1397,11 +1434,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; uint64_t update_msg_ref = 0; CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var); update_msg_ref = (uint64_t)update_msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - BroadcastChannelAnnouncement */; (void) msg_ref; (void) update_msg_ref; } @@ -1410,6 +1449,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - BroadcastNodeAnnouncement */; (void) msg_ref; } @@ -1418,6 +1458,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - BroadcastChannelUpdate */; (void) msg_ref; } @@ -1428,6 +1469,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendChannelUpdate */; (void) node_id_arr; (void) msg_ref; } @@ -1444,6 +1486,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendChannelRangeQuery */; (void) node_id_arr; (void) msg_ref; } @@ -1454,6 +1497,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendShortIdsQuery */; (void) node_id_arr; (void) msg_ref; } @@ -1464,31 +1508,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_ uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return 0 /* LDKMessageSendEvent - SendReplyChannelRange */; (void) node_id_arr; (void) msg_ref; } default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_MessageSendEventZ_new(uint32_tArray elems) { - LDKCVec_MessageSendEventZ *ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVec_MessageSendEventZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr); - arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) { LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1496,9 +1522,6 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InitFeaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1506,6 +1529,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1516,12 +1540,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeFeaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1529,6 +1551,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1539,12 +1562,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelFeaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1552,6 +1573,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1562,12 +1584,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1575,6 +1595,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1585,12 +1606,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1598,6 +1617,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParameters uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1608,12 +1628,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParameters uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1621,6 +1639,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1631,12 +1650,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1644,6 +1661,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOut uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1654,12 +1672,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOut uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1667,6 +1683,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1677,12 +1694,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutp uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1696,12 +1711,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SpendableOutputDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneNoneZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneNoneZ_get_ok(uint32_t arg) { LDKCResult_NoneNoneZ *val = (LDKCResult_NoneNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1741,9 +1754,6 @@ ptrArray __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_Signat return ret_arr; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(uint32_t arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1757,9 +1767,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_SignatureCVec CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SignatureNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_SignatureNoneZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_SignatureNoneZ_get_ok(uint32_t arg) { LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1830,6 +1837,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th holder_tx_var = HolderCommitmentTransaction_clone(holder_tx); CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); holder_tx_ref = (uint64_t)holder_tx_var.inner; if (holder_tx_var.is_owned) { holder_tx_ref |= 1; @@ -1838,7 +1846,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { @@ -1856,6 +1864,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L commitment_tx_var = CommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -1864,7 +1873,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); - ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) { @@ -1875,7 +1884,7 @@ LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const vo void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) { @@ -1885,6 +1894,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -1893,7 +1903,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); - ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32]) { @@ -1908,7 +1918,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) { @@ -1924,6 +1934,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -1932,7 +1943,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) { @@ -1948,6 +1959,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -1956,7 +1968,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) { @@ -1966,6 +1978,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* closing_tx_var = ClosingTransaction_clone(closing_tx); CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var); closing_tx_ref = (uint64_t)closing_tx_var.inner; if (closing_tx_var.is_owned) { closing_tx_ref |= 1; @@ -1974,7 +1987,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) { @@ -1984,6 +1997,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void msg_var = UnsignedChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -1992,7 +2006,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); - ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { @@ -2002,6 +2016,7 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); channel_parameters_ref = (uint64_t)channel_parameters_var.inner; if (channel_parameters_var.is_owned) { channel_parameters_ref |= 1; @@ -2020,7 +2035,7 @@ static inline LDKBaseSign LDKBaseSign_init (/*TODO: JS Object Reference */void* LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKBaseSign ret = { .this_arg = (void*) calls, @@ -2073,6 +2088,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_validate_holder_com LDKHolderCommitmentTransaction holder_tx_conv; holder_tx_conv.inner = (void*)(holder_tx & (~1)); holder_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv); return (uint64_t)ret_conv; @@ -2094,6 +2110,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_counterparty_c LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -2119,6 +2136,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_holder_commitm LDKHolderCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -2158,6 +2176,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_justice_revoke LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_justice_revoked_htlc)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -2178,6 +2197,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_counterparty_h LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -2190,6 +2210,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_closing_transa LDKClosingTransaction closing_tx_conv; closing_tx_conv.inner = (void*)(closing_tx & (~1)); closing_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv); return (uint64_t)ret_conv; @@ -2202,6 +2223,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_channel_announ LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -2214,6 +2236,7 @@ void __attribute__((visibility("default"))) TS_BaseSign_ready_channel(uint32_t LDKChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv); } @@ -2230,6 +2253,7 @@ uint32_t __attribute__((visibility("default"))) TS_BaseSign_get_pubkeys(uint32_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -2271,7 +2295,7 @@ static inline LDKSign LDKSign_init (/*TODO: JS Object Reference */void* o, /*TOD LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKSign ret = { .this_arg = (void*) calls, @@ -2299,9 +2323,6 @@ int8_tArray __attribute__((visibility("default"))) TS_Sign_write(uint32_t this_ return ret_arr; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_SignDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2316,12 +2337,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RecoverableSignatureNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_RecoverableSignatureNoneZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_RecoverableSignatureNoneZ_get_ok(uint32_t arg) { LDKCResult_RecoverableSignatureNoneZ *val = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2341,9 +2360,6 @@ static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *or } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_CVec_CVec_u8ZZNoneZ*)arg)->result_ok; -} ptrArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(uint32_t arg) { LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2365,9 +2381,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_g CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InMemorySignerDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2375,6 +2388,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2385,28 +2399,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_TxOutZ_new(uint32_tArray elems) { - LDKCVec_TxOutZ *ret = MALLOC(sizeof(LDKCVec_TxOutZ), "LDKCVec_TxOutZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVec_TxOutZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr); - arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2414,9 +2410,6 @@ static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_TransactionNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_TransactionNoneZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_TransactionNoneZ_get_ok(uint32_t arg) { LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2449,6 +2442,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMoni uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -2456,25 +2450,6 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMoni return ret_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_BlockHashChannelMonitorZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_BlockHashChannelMonitorZZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * ret->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) { LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2482,9 +2457,6 @@ static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashCh } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)arg)->result_ok; -} uint32_tArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(uint32_t arg) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2550,15 +2522,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKAPIError_ref_from_ptr(uint uint64_t script_ref = 0; CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); script_ref = (uint64_t)script_var.inner & ~1; return 0 /* LDKAPIError - IncompatibleShutdownScript */; (void) script_ref; } default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneAPIErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneAPIErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2570,25 +2540,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneAPIErrorZ_get uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_CResult_NoneAPIErrorZZ_new(uint32_tArray elems) { - LDKCVec_CResult_NoneAPIErrorZZ *ret = MALLOC(sizeof(LDKCVec_CResult_NoneAPIErrorZZ), "LDKCVec_CResult_NoneAPIErrorZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * ret->datalen, "LDKCVec_CResult_NoneAPIErrorZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr); - arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) { LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2596,25 +2547,6 @@ static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(c } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_APIErrorZ_new(uint32_tArray elems) { - LDKCVec_APIErrorZ *ret = MALLOC(sizeof(LDKCVec_APIErrorZ), "LDKCVec_APIErrorZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKAPIError) * ret->datalen, "LDKCVec_APIErrorZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr); - arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) { LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2622,9 +2554,6 @@ static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *or } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult__u832APIErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult__u832APIErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult__u832APIErrorZ_get_ok(uint32_t arg) { LDKCResult__u832APIErrorZ *val = (LDKCResult__u832APIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2688,6 +2617,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKPaymentSendFailure_ref_fro if ((uint64_t)failed_paths_retry_var.inner > 4096) { CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1; } int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -2697,9 +2627,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKPaymentSendFailure_ref_fro default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(uint32_t arg) { - return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(uint32_t arg) { LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -2713,9 +2640,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentS uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NonePaymentSendFailureZ_result_ok(uint32_t arg) { - return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NonePaymentSendFailureZ_get_ok(uint32_t arg) { LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -2747,9 +2671,6 @@ int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymen return ret_arr; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(uint32_t arg) { - return ((LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(uint32_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -2790,25 +2711,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKNetAddress_ref_from_ptr(ui default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_NetAddressZ_new(uint32_tArray elems) { - LDKCVec_NetAddressZ *ret = MALLOC(sizeof(LDKCVec_NetAddressZ), "LDKCVec_NetAddressZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVec_NetAddressZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr); - arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2836,9 +2738,6 @@ int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymen return ret_arr; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretAPIErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PaymentSecretAPIErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretAPIErrorZ_get_ok(uint32_t arg) { LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2852,25 +2751,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretAPIE uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelMonitorZ_new(uint32_tArray elems) { - LDKCVec_ChannelMonitorZ *ret = MALLOC(sizeof(LDKCVec_ChannelMonitorZ), "LDKCVec_ChannelMonitorZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVec_ChannelMonitorZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKChannelMonitor arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelMonitor_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) { LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2899,6 +2779,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -2907,6 +2788,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t monitor_ref = 0; CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = (uint64_t)monitor_var.inner; if (monitor_var.is_owned) { monitor_ref |= 1; @@ -2915,7 +2797,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) { @@ -2924,6 +2806,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -2932,6 +2815,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t update_ref = 0; CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -2940,7 +2824,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { @@ -2958,7 +2842,7 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1); CHECK_ACCESS(ret_conv_14_ptr); LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr); - ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1)); + FREE((void*)ret_conv_14); ret_constr.data[o] = ret_conv_14_conv; } return ret_constr; @@ -2993,10 +2877,12 @@ uint32_t __attribute__((visibility("default"))) TS_Watch_watch_channel(uint32_t LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitor monitor_conv; monitor_conv.inner = (void*)(monitor & (~1)); monitor_conv.is_owned = (monitor & 1) || (monitor == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); monitor_conv = ChannelMonitor_clone(&monitor_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); @@ -3010,10 +2896,12 @@ uint32_t __attribute__((visibility("default"))) TS_Watch_update_channel(uint32_ LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = (update & 1) || (update == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); update_conv = ChannelMonitorUpdate_clone(&update_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); @@ -3137,7 +3025,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t LDKShutdownScript ret_conv; ret_conv.inner = (void*)(ret & (~1)); ret_conv.is_owned = (ret & 1) || (ret == 0); - ret_conv = ShutdownScript_clone(&ret_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); return ret_conv; } LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { @@ -3146,7 +3034,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKSign ret_conv = *(LDKSign*)(ret_ptr); - ret_conv = Sign_clone(&ret_conv); + FREE((void*)ret); return ret_conv; } LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) { @@ -3166,7 +3054,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr); - ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKCVec_u8Z invoice_preimage) { @@ -3179,7 +3067,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); - ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) { @@ -3237,6 +3125,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_shutdown_s uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3344,11 +3233,19 @@ static void LDKLogger_JCalls_free(void* this_arg) { FREE(j_calls); } } -void log_LDKLogger_jcall(const void* this_arg, const char* record) { +void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; - const char* record_str = record; - jstring record_conv = str_ref_to_ts(record_str, strlen(record_str)); - js_invoke_function_1(j_calls->log_meth, record_conv); + LDKRecord record_var = *record; + uint64_t record_ref = 0; + record_var = Record_clone(record); + CHECK((((uint64_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); + record_ref = (uint64_t)record_var.inner; + if (record_var.is_owned) { + record_ref |= 1; + } + js_invoke_function_1(j_calls->log_meth, record_ref); } static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; @@ -3390,13 +3287,11 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMana uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner & ~1; return ret_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3411,12 +3306,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHash uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3424,6 +3317,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3434,12 +3328,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_OutPointDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3447,6 +3339,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3457,6 +3350,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -3561,9 +3455,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_TypeZ_ref_from_ptr default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_COption_TypeZDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_COption_TypeZDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_TypeZDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3577,6 +3468,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_TypeZDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -3593,6 +3485,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKPaymentError_ref_from_ptr( uint64_t routing_ref = 0; CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var); routing_ref = (uint64_t)routing_var.inner & ~1; return 0 /* LDKPaymentError - Routing */; (void) routing_ref; } @@ -3603,9 +3496,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKPaymentError_ref_from_ptr( default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentErrorZ_get_ok(uint32_t arg) { LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3619,9 +3509,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentE uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SiPrefixNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_SiPrefixNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SiPrefixNoneZ_get_ok(uint32_t arg) { LDKCResult_SiPrefixNoneZ *val = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3633,9 +3520,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_SiPrefixNoneZ_get_err CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_InvoiceNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_get_ok(uint32_t arg) { LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3643,6 +3527,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_get_ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3651,9 +3536,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_get_err( CHECK(!val->result_ok); return *val->contents.err; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_SignedRawInvoiceNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_SignedRawInvoiceNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignedRawInvoiceNoneZ_get_ok(uint32_t arg) { LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3661,6 +3543,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignedRawInvoiceN uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3678,6 +3561,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3704,6 +3588,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3711,9 +3596,6 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi return ret_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PayeePubKeyErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ_get_ok(uint32_t arg) { LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3721,6 +3603,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3730,25 +3613,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_PrivateRouteZ_new(uint32_tArray elems) { - LDKCVec_PrivateRouteZ *ret = MALLOC(sizeof(LDKCVec_PrivateRouteZ), "LDKCVec_PrivateRouteZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKPrivateRoute) * ret->datalen, "LDKCVec_PrivateRouteZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKPrivateRoute arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = PrivateRoute_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3756,9 +3620,6 @@ static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_Priva } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestampCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PositiveTimestampCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestampCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3766,6 +3627,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestamp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3775,9 +3637,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestamp uint32_t err_conv = LDKCreationError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneSemanticErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneSemanticErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneSemanticErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneSemanticErrorZ *val = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3789,9 +3648,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneSemanticError uint32_t err_conv = LDKSemanticError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InvoiceSemanticErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticErrorZ_get_ok(uint32_t arg) { LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3799,6 +3655,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticEr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3808,9 +3665,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticEr uint32_t err_conv = LDKSemanticError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_DescriptionCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3818,6 +3672,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreati uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3827,9 +3682,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreati uint32_t err_conv = LDKCreationError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ExpiryTimeCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3837,6 +3689,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreatio uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3846,9 +3699,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreatio uint32_t err_conv = LDKCreationError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PrivateRouteCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3856,6 +3706,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreat uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3865,9 +3716,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreat uint32_t err_conv = LDKCreationError_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_StringErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_StringErrorZ*)arg)->result_ok; -} jstring __attribute__((visibility("default"))) TS_LDKCResult_StringErrorZ_get_ok(uint32_t arg) { LDKCResult_StringErrorZ *val = (LDKCResult_StringErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3881,9 +3729,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StringErrorZ_get_ uint32_t err_conv = LDKSecp256k1Error_to_js((*val->contents.err)); return err_conv; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3891,6 +3736,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpd uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3901,11 +3747,39 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpd uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_HTLCUpdateDecodeErrorZ*)arg)->result_ok; +uint32_t __attribute__((visibility("default"))) TS_LDKCOption_MonitorEventZ_ref_from_ptr(uint32_t ptr) { + LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_MonitorEventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return 0 /* LDKCOption_MonitorEventZ - Some */; (void) some_ref; + } + case LDKCOption_MonitorEventZ_None: { + return 0 /* LDKCOption_MonitorEventZ - None */; + } + default: abort(); + } +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint32_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err(uint32_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; } uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); @@ -3914,6 +3788,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3924,12 +3799,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3942,6 +3815,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdate uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -3954,6 +3828,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_get_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3994,25 +3869,6 @@ int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_get_b( return ret_arr; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_u32ScriptZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_u32ScriptZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32ScriptZZ), "LDKCVec_C2Tuple_u32ScriptZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * ret->datalen, "LDKCVec_C2Tuple_u32ScriptZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4049,25 +3905,6 @@ uint32_tArray __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tupl return ret_arr; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4075,166 +3912,6 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKPaymentPurpose_ref_from_ptr(uint32_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); - switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: { - int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_preimage_arr + 4), obj->invoice_payment.payment_preimage.data, 32); - int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_secret_arr + 4), obj->invoice_payment.payment_secret.data, 32); - return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr; (void) obj->invoice_payment.user_payment_id; - } - case LDKPaymentPurpose_SpontaneousPayment: { - int8_tArray spontaneous_payment_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(spontaneous_payment_arr + 4), obj->spontaneous_payment.data, 32); - return 0 /* LDKPaymentPurpose - SpontaneousPayment */; (void) spontaneous_payment_arr; - } - default: abort(); - } -} -uint32_t __attribute__((visibility("default"))) TS_LDKClosureReason_ref_from_ptr(uint32_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); - switch(obj->tag) { - case LDKClosureReason_CounterpartyForceClosed: { - LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; - jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len); - return 0 /* LDKClosureReason - CounterpartyForceClosed */; (void) peer_msg_conv; - } - case LDKClosureReason_HolderForceClosed: { - return 0 /* LDKClosureReason - HolderForceClosed */; - } - case LDKClosureReason_CooperativeClosure: { - return 0 /* LDKClosureReason - CooperativeClosure */; - } - case LDKClosureReason_CommitmentTxConfirmed: { - return 0 /* LDKClosureReason - CommitmentTxConfirmed */; - } - case LDKClosureReason_ProcessingError: { - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len); - return 0 /* LDKClosureReason - ProcessingError */; (void) err_conv; - } - case LDKClosureReason_DisconnectedPeer: { - return 0 /* LDKClosureReason - DisconnectedPeer */; - } - case LDKClosureReason_OutdatedChannelManager: { - return 0 /* LDKClosureReason - OutdatedChannelManager */; - } - default: abort(); - } -} -uint32_t __attribute__((visibility("default"))) TS_LDKEvent_ref_from_ptr(uint32_t ptr) { - LDKEvent *obj = (LDKEvent*)(ptr & ~1); - switch(obj->tag) { - case LDKEvent_FundingGenerationReady: { - int8_tArray temporary_channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(temporary_channel_id_arr + 4), obj->funding_generation_ready.temporary_channel_id.data, 32); - LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; - int8_tArray output_script_arr = init_arr(output_script_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(output_script_arr + 4), output_script_var.data, output_script_var.datalen); - return 0 /* LDKEvent - FundingGenerationReady */; (void) temporary_channel_id_arr; (void) obj->funding_generation_ready.channel_value_satoshis; (void) output_script_arr; (void) obj->funding_generation_ready.user_channel_id; - } - case LDKEvent_PaymentReceived: { - int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_received.payment_hash.data, 32); - uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; - return 0 /* LDKEvent - PaymentReceived */; (void) payment_hash_arr; (void) obj->payment_received.amt; (void) purpose_ref; - } - case LDKEvent_PaymentSent: { - int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_sent.payment_id.data, 32); - int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_preimage_arr + 4), obj->payment_sent.payment_preimage.data, 32); - int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_sent.payment_hash.data, 32); - uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; - return 0 /* LDKEvent - PaymentSent */; (void) payment_id_arr; (void) payment_preimage_arr; (void) payment_hash_arr; (void) fee_paid_msat_ref; - } - case LDKEvent_PaymentPathFailed: { - int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_path_failed.payment_id.data, 32); - int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_path_failed.payment_hash.data, 32); - uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; - LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; - uint32_tArray path_arr = NULL; - path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); - uint32_t *path_arr_ptr = (uint32_t*)(path_arr + 4); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; - path_arr_ptr[k] = path_conv_10_ref; - } - - uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; - LDKRouteParameters retry_var = obj->payment_path_failed.retry; - uint64_t retry_ref = 0; - if ((uint64_t)retry_var.inner > 4096) { - CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - retry_ref = (uint64_t)retry_var.inner & ~1; - } - return 0 /* LDKEvent - PaymentPathFailed */; (void) payment_id_arr; (void) payment_hash_arr; (void) obj->payment_path_failed.rejected_by_dest; (void) network_update_ref; (void) obj->payment_path_failed.all_paths_failed; (void) path_arr; (void) short_channel_id_ref; (void) retry_ref; - } - case LDKEvent_PendingHTLCsForwardable: { - return 0 /* LDKEvent - PendingHTLCsForwardable */; (void) obj->pending_htl_cs_forwardable.time_forwardable; - } - case LDKEvent_SpendableOutputs: { - LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; - uint32_tArray outputs_arr = NULL; - outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); - uint32_t *outputs_arr_ptr = (uint32_t*)(outputs_arr + 4); - for (size_t b = 0; b < outputs_var.datalen; b++) { - uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; - outputs_arr_ptr[b] = outputs_conv_27_ref; - } - - return 0 /* LDKEvent - SpendableOutputs */; (void) outputs_arr; - } - case LDKEvent_PaymentForwarded: { - uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; - return 0 /* LDKEvent - PaymentForwarded */; (void) fee_earned_msat_ref; (void) obj->payment_forwarded.claim_from_onchain_tx; - } - case LDKEvent_ChannelClosed: { - int8_tArray channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(channel_id_arr + 4), obj->channel_closed.channel_id.data, 32); - uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; - return 0 /* LDKEvent - ChannelClosed */; (void) channel_id_arr; (void) obj->channel_closed.user_channel_id; (void) reason_ref; - } - case LDKEvent_DiscardFunding: { - int8_tArray channel_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(channel_id_arr + 4), obj->discard_funding.channel_id.data, 32); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = init_arr(transaction_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); - memcpy((uint8_t*)(transaction_arr + 4), transaction_var.data, transaction_var.datalen); - return 0 /* LDKEvent - DiscardFunding */; (void) channel_id_arr; (void) transaction_arr; - } - default: abort(); - } -} -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_EventZ_new(uint32_tArray elems) { - LDKCVec_EventZ *ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVec_EventZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr); - arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4261,25 +3938,6 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_get_b(uint return (uint64_t)ret_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_u32TxOutZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_u32TxOutZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32TxOutZZ), "LDKCVec_C2Tuple_u32TxOutZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * ret->datalen, "LDKCVec_C2Tuple_u32TxOutZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) { LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4316,25 +3974,6 @@ uint32_tArray __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tupl return ret_arr; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4360,25 +3999,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKBalance_ref_from_ptr(uint3 default: abort(); } } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_BalanceZ_new(uint32_tArray elems) { - LDKCVec_BalanceZ *ret = MALLOC(sizeof(LDKCVec_BalanceZ), "LDKCVec_BalanceZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKBalance) * ret->datalen, "LDKCVec_BalanceZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr); - arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) { LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4386,9 +4006,6 @@ static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4404,12 +4021,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHash uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneLightningErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NoneLightningErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NoneLightningErrorZ_get_ok(uint32_t arg) { LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4422,6 +4037,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneLightningErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -4445,25 +4061,6 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_get_b return (uint64_t)ret_ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C2Tuple_PublicKeyTypeZZ_new(uint32_tArray elems) { - LDKCVec_C2Tuple_PublicKeyTypeZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_PublicKeyTypeZZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * ret->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr); - arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) { LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4471,9 +4068,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolLightningErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok; -} jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolLightningErrorZ_get_ok(uint32_t arg) { LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4486,6 +4080,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_boolLightningErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -4498,6 +4093,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4514,6 +4110,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4530,6 +4127,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4537,25 +4135,6 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC return ret_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(uint32_tArray elems) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * ret->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1); - CHECK_ACCESS(arr_elem_ptr); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr); - arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1)); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4563,25 +4142,6 @@ static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CV } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_NodeAnnouncementZ_new(uint32_tArray elems) { - LDKCVec_NodeAnnouncementZ *ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVec_NodeAnnouncementZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKNodeAnnouncement arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = NodeAnnouncement_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4589,9 +4149,6 @@ static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCV } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok; -} int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint32_t arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4607,12 +4164,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CVec_u8ZPeerHandl uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NonePeerHandleErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok; -} void __attribute__((visibility("default"))) TS_LDKCResult_NonePeerHandleErrorZ_get_ok(uint32_t arg) { LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4625,12 +4180,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NonePeerHandleErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolPeerHandleErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok; -} jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolPeerHandleErrorZ_get_ok(uint32_t arg) { LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4643,12 +4196,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_boolPeerHandleErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeIdDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4656,6 +4207,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4666,6 +4218,24 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint32_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +uint32_t __attribute__((visibility("default"))) TS_LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint32_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -4688,7 +4258,7 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); - ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) { @@ -4740,9 +4310,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_AccessZ_ref_from_p default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_DirectionalChannelInfoDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4750,6 +4317,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChanne uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4760,12 +4328,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChanne uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelInfoDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4773,6 +4339,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4783,12 +4350,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RoutingFeesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4796,6 +4361,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4806,12 +4372,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4819,6 +4383,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementI uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4829,31 +4394,15 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementI uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_u64Z_new(int64_tArray elems) { - LDKCVec_u64Z *ret = MALLOC(sizeof(LDKCVec_u64Z), "LDKCVec_u64Z"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVec_u64Z Data"); - int64_t *java_elems = (int64_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - } - return (uint64_t)ret; -} static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeInfoDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4861,6 +4410,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4871,12 +4421,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NetworkGraphDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4884,6 +4432,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4894,6 +4443,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -4918,9 +4468,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_CVec_NetAddressZZ_ default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetAddressDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetAddressDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4934,28 +4481,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetAddressDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateAddHTLCZ_new(uint32_tArray elems) { - LDKCVec_UpdateAddHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateAddHTLCZ), "LDKCVec_UpdateAddHTLCZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVec_UpdateAddHTLCZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKUpdateAddHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateAddHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) { LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4963,25 +4492,6 @@ static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_Upd } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateFulfillHTLCZ_new(uint32_tArray elems) { - LDKCVec_UpdateFulfillHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFulfillHTLCZ), "LDKCVec_UpdateFulfillHTLCZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVec_UpdateFulfillHTLCZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKUpdateFulfillHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFulfillHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) { LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4989,25 +4499,6 @@ static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDK } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateFailHTLCZ_new(uint32_tArray elems) { - LDKCVec_UpdateFailHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailHTLCZ), "LDKCVec_UpdateFailHTLCZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVec_UpdateFailHTLCZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKUpdateFailHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) { LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5015,25 +4506,6 @@ static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_U } return ret; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateFailMalformedHTLCZ_new(uint32_tArray elems) { - LDKCVec_UpdateFailMalformedHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailMalformedHTLCZ), "LDKCVec_UpdateFailMalformedHTLCZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVec_UpdateFailMalformedHTLCZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKUpdateFailMalformedHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailMalformedHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) { LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5041,9 +4513,6 @@ static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clo } return ret; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_AcceptChannelDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5051,6 +4520,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5061,12 +4531,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_AnnouncementSignaturesDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5074,6 +4542,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSigna uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5084,12 +4553,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSigna uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelReestablishDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5097,6 +4564,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablis uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5107,12 +4575,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablis uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ClosingSignedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5120,6 +4586,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5130,12 +4597,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5143,6 +4608,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeR uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5153,12 +4619,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeR uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_CommitmentSignedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5166,6 +4630,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5176,12 +4641,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_FundingCreatedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5189,6 +4652,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5199,12 +4663,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_FundingSignedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5212,6 +4674,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5222,12 +4685,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_FundingLockedDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5235,6 +4696,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5245,12 +4707,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InitDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5258,6 +4718,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5268,12 +4729,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_OpenChannelDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5281,6 +4740,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5291,12 +4751,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_RevokeAndACKDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5304,6 +4762,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5314,12 +4773,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ShutdownDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5327,6 +4784,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5337,12 +4795,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateFailHTLCDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5350,6 +4806,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5360,12 +4817,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5373,6 +4828,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalform uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5383,12 +4839,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalform uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateFeeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5396,6 +4850,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeEr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5406,12 +4861,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5419,6 +4872,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLC uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5429,12 +4883,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLC uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UpdateAddHTLCDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5442,6 +4894,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5452,12 +4905,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PingDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5465,6 +4916,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5475,12 +4927,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_PongDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5488,6 +4938,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_ uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5498,12 +4949,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_ uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5511,6 +4960,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAn uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5521,12 +4971,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAn uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5534,6 +4982,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnounceme uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5544,12 +4993,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnounceme uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5557,6 +5004,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5567,12 +5015,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUp uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ChannelUpdateDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5580,6 +5026,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5590,12 +5037,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ErrorMessageDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5603,6 +5048,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5613,12 +5059,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5626,6 +5070,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnou uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5636,12 +5081,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnou uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_NodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5649,6 +5092,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5659,12 +5103,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5672,6 +5114,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5682,12 +5125,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5695,6 +5136,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5705,12 +5147,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_QueryChannelRangeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5718,6 +5158,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRange uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5728,12 +5169,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRange uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5741,6 +5180,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRange uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5751,12 +5191,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRange uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint32_t arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5764,6 +5202,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFi uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5774,6 +5213,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFi uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5790,9 +5230,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKSignOrCreationError_ref_fr default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSignOrCreationErrorZ_result_ok(uint32_t arg) { - return ((LDKCResult_InvoiceSignOrCreationErrorZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSignOrCreationErrorZ_get_ok(uint32_t arg) { LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5800,6 +5237,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSignOrCrea uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5837,6 +5275,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void uint64_t output_ref = 0; CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = (uint64_t)output_var.inner; if (output_var.is_owned) { output_ref |= 1; @@ -5845,7 +5284,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr); - ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) { @@ -5891,6 +5330,7 @@ uint32_t __attribute__((visibility("default"))) TS_Filter_register_output(uint3 LDKWatchedOutput output_conv; output_conv.inner = (void*)(output & (~1)); output_conv.is_owned = (output & 1) || (output == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv); output_conv = WatchedOutput_clone(&output_conv); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); @@ -5913,9 +5353,6 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCOption_FilterZ_ref_from_p default: abort(); } } -jboolean __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMonitorNoneZ_result_ok(uint32_t arg) { - return ((LDKCResult_LockedChannelMonitorNoneZ*)arg)->result_ok; -} uint32_t __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMonitorNoneZ_get_ok(uint32_t arg) { LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5923,6 +5360,7 @@ uint32_t __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMoni uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5931,25 +5369,6 @@ void __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMonitorN CHECK(!val->result_ok); return *val->contents.err; } -uint32_t __attribute__((visibility("default"))) TS_LDKCVec_OutPointZ_new(uint32_tArray elems) { - LDKCVec_OutPointZ *ret = MALLOC(sizeof(LDKCVec_OutPointZ), "LDKCVec_OutPointZ"); - ret->datalen = *((uint32_t*)elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKOutPoint) * ret->datalen, "LDKCVec_OutPointZ Data"); - uint32_t *java_elems = (uint32_t*)(elems + 4); - for (size_t i = 0; i < ret->datalen; i++) { - uint32_t arr_elem = java_elems[i]; - LDKOutPoint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = OutPoint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - } - return (uint64_t)ret; -} static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) { LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5983,7 +5402,7 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1); CHECK_ACCESS(ret_conv_18_ptr); LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr); - ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1)); + FREE((void*)ret_conv_18); ret_constr.data[s] = ret_conv_18_conv; } return ret_constr; @@ -6365,6 +5784,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -6374,6 +5794,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -6382,6 +5803,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -6390,7 +5812,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { @@ -6399,6 +5821,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -6409,6 +5832,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal update_var = ChannelMonitorUpdate_clone(update); CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -6419,6 +5843,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -6427,6 +5852,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -6435,7 +5861,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); - ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) { @@ -6467,13 +5893,16 @@ uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel( LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv); @@ -6487,16 +5916,20 @@ uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_cha LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv); @@ -6561,6 +5994,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -6570,6 +6004,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = OpenChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6584,6 +6019,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -6593,6 +6029,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = AcceptChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6608,6 +6045,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingCreated_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6623,6 +6061,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6638,6 +6077,7 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingLocked_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6653,6 +6093,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub their_features_var = InitFeatures_clone(their_features); CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -6662,6 +6103,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = Shutdown_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6677,6 +6119,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ClosingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6692,6 +6135,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6707,6 +6151,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6722,6 +6167,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6737,6 +6183,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6752,6 +6199,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6767,6 +6215,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6782,6 +6231,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6797,6 +6247,7 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6818,6 +6269,7 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl msg_var = Init_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6833,6 +6285,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6848,6 +6301,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6863,6 +6317,7 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -6922,10 +6377,12 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_ope LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -6939,10 +6396,12 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_acc LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -6956,6 +6415,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -6969,6 +6429,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -6982,6 +6443,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_fun LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -6995,9 +6457,11 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_shu LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv); } @@ -7011,6 +6475,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_clo LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7024,6 +6489,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateAddHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7037,6 +6503,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateFulfillHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7050,6 +6517,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateFailHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7063,6 +6531,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateFailMalformedHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7076,6 +6545,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_com LDKCommitmentSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7089,6 +6559,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_rev LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7102,6 +6573,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_upd LDKUpdateFee msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7115,6 +6587,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_ann LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7138,6 +6611,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_conne LDKInit msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7151,6 +6625,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_cha LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7164,6 +6639,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_cha LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7177,6 +6653,7 @@ void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_err LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -7217,6 +6694,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_var = NodeAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7225,7 +6703,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) { @@ -7235,6 +6713,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_var = ChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7243,7 +6722,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) { @@ -7253,6 +6732,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7261,7 +6741,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); - ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) { @@ -7279,7 +6759,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1); CHECK_ACCESS(ret_conv_59_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr); - ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1)); + FREE((void*)ret_conv_59); ret_constr.data[h] = ret_conv_59_conv; } return ret_constr; @@ -7301,7 +6781,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j LDKNodeAnnouncement ret_conv_18_conv; ret_conv_18_conv.inner = (void*)(ret_conv_18 & (~1)); ret_conv_18_conv.is_owned = (ret_conv_18 & 1) || (ret_conv_18 == 0); - ret_conv_18_conv = NodeAnnouncement_clone(&ret_conv_18_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv); ret_constr.data[s] = ret_conv_18_conv; } return ret_constr; @@ -7315,6 +6795,7 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK init_var = Init_clone(init); CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = (uint64_t)init_var.inner; if (init_var.is_owned) { init_ref |= 1; @@ -7329,6 +6810,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7337,7 +6819,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) { @@ -7348,6 +6830,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7356,7 +6839,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) { @@ -7367,6 +6850,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7375,7 +6859,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) { @@ -7386,6 +6870,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -7394,7 +6879,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) { @@ -7437,6 +6922,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -7449,6 +6935,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -7461,6 +6948,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -7500,6 +6988,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_g uint64_t ret_conv_18_ref = 0; CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var); ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner; if (ret_conv_18_var.is_owned) { ret_conv_18_ref |= 1; @@ -7521,6 +7010,7 @@ void __attribute__((visibility("default"))) TS_RoutingMessageHandler_sync_routi LDKInit init_conv; init_conv.inner = (void*)(init & (~1)); init_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv); (this_arg_conv->sync_routing_table)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); } @@ -7534,6 +7024,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -7550,6 +7041,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKReplyShortChannelIdsEnd msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -7566,6 +7058,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -7582,6 +7075,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -7608,7 +7102,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); - ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) { @@ -7668,7 +7162,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); - ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) { @@ -7686,7 +7180,7 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1); CHECK_ACCESS(ret_conv_25_ptr); LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr); - ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1)); + FREE((void*)ret_conv_25); ret_constr.data[z] = ret_conv_25_conv; } return ret_constr; @@ -7860,6 +7354,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor source_var = NodeId_clone(source); CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); source_ref = (uint64_t)source_var.inner; if (source_var.is_owned) { source_ref |= 1; @@ -7869,6 +7364,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor target_var = NodeId_clone(target); CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); target_ref = (uint64_t)target_var.inner; if (target_var.is_owned) { target_ref |= 1; @@ -7886,6 +7382,7 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t path_conv_10_ref = 0; CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); path_conv_10_ref = (uint64_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; @@ -7935,9 +7432,11 @@ int64_t __attribute__((visibility("default"))) TS_Score_channel_penalty_msat(ui LDKNodeId source_conv; source_conv.inner = (void*)(source & (~1)); source_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); LDKNodeId target_conv; target_conv.inner = (void*)(target & (~1)); target_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv); return ret_val; } @@ -7958,6 +7457,7 @@ void __attribute__((visibility("default"))) TS_Score_payment_path_failed(uint32 LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -7993,6 +7493,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi // Warning: we may need a move here but no clone is available for LDKChannelManager CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = (uint64_t)channel_manager_var.inner; if (channel_manager_var.is_owned) { channel_manager_ref |= 1; @@ -8001,7 +7502,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); - ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKChannelManagerPersister_JCalls_cloned(LDKChannelManagerPersister* new_obj) { @@ -8032,6 +7533,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerPersister_pers LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); return (uint64_t)ret_conv; @@ -8100,7 +7602,7 @@ LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { LDKChannelDetails ret_conv_16_conv; ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1)); ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0); - ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); ret_constr.data[q] = ret_conv_16_conv; } return ret_constr; @@ -8112,6 +7614,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -8124,7 +7627,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) { @@ -8134,6 +7637,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -8144,7 +7648,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) { @@ -8193,6 +7697,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Payer_first_hops(uint32 uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -8211,6 +7716,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payer_send_payment(uint32_t LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32); @@ -8229,6 +7735,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payer_retry_payment(uint32_t LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(*((uint32_t*)payment_id) == 32); memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32); @@ -8257,6 +7764,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, params_var = RouteParameters_clone(params); CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); params_ref = (uint64_t)params_var.inner; if (params_var.is_owned) { params_ref |= 1; @@ -8272,6 +7780,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, uint64_t first_hops_conv_16_ref = 0; CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner; if (first_hops_conv_16_var.is_owned) { first_hops_conv_16_ref |= 1; @@ -8286,7 +7795,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); - ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); return ret_conv; } static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) { @@ -8320,6 +7829,7 @@ uint32_t __attribute__((visibility("default"))) TS_Router_find_route(uint32_t t LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != 0) { @@ -8334,6 +7844,7 @@ uint32_t __attribute__((visibility("default"))) TS_Router_find_route(uint32_t t LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } first_hops_ptr = &first_hops_constr; @@ -8389,6 +7900,17 @@ void __attribute__((visibility("default"))) TS_TxOut_free(uint32_t _res) { TxOut_free(_res_conv); } +static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(arg); + return (uint64_t)ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_TxOut_clone_ptr(uint32_t arg) { + LDKTxOut* arg_conv = (LDKTxOut*)(arg & ~1); + int64_t ret_val = TxOut_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_TxOut_clone(uint32_t orig) { LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); @@ -8417,6 +7939,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SecretKeyErrorZ_err( return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SecretKeyErrorZ_is_ok(uint32_t o) { + LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_SecretKeyErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SecretKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8442,6 +7970,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_err( return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_is_ok(uint32_t o) { + LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PublicKeyErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8451,6 +7985,17 @@ void __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_free(uin CResult_PublicKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_clone(uint32_t orig) { LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)(orig & ~1); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); @@ -8462,6 +8007,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecode LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); @@ -8472,12 +8018,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8487,6 +8040,17 @@ void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErro CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint32_t orig) { LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); @@ -8498,6 +8062,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDec LDKChannelPublicKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelPublicKeys_clone(&o_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); @@ -8508,12 +8073,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8523,6 +8095,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeE CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); @@ -8534,6 +8117,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); @@ -8547,6 +8131,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint32_t o) { + LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8556,6 +8146,17 @@ void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_fre CResult_TxCreationKeysErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_clone(uint32_t orig) { LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); @@ -8586,6 +8187,18 @@ void __attribute__((visibility("default"))) TS_COption_u32Z_free(uint32_t _res) COption_u32Z_free(_res_conv); } +static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_u32Z_clone_ptr(uint32_t arg) { + LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)arg; + int64_t ret_val = COption_u32Z_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_u32Z_clone(uint32_t orig) { LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); @@ -8598,6 +8211,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitme LDKHTLCOutputInCommitment o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCOutputInCommitment_clone(&o_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); @@ -8608,12 +8222,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitme LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8623,6 +8244,17 @@ void __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDe CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint32_t orig) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); @@ -8634,6 +8266,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelT LDKCounterpartyChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -8644,12 +8277,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelT LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8659,6 +8299,17 @@ void __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTrans CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint32_t orig) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); @@ -8670,6 +8321,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTransactionPa LDKChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelTransactionParameters_clone(&o_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -8680,12 +8332,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTransactionPa LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8695,6 +8354,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParame CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); @@ -8724,6 +8394,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTran LDKHolderCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HolderCommitmentTransaction_clone(&o_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -8734,12 +8405,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTran LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8749,6 +8427,17 @@ void __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransact CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint32_t orig) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); @@ -8760,6 +8449,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTrans LDKBuiltCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = BuiltCommitmentTransaction_clone(&o_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -8770,12 +8460,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTrans LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8785,6 +8482,17 @@ void __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransacti CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint32_t orig) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); @@ -8796,6 +8504,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransa LDKTrustedClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedClosingTransaction LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); @@ -8808,6 +8517,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransa return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint32_t o) { + LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8821,6 +8536,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentTransactio LDKCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentTransaction_clone(&o_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -8831,12 +8547,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentTransactio LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8846,6 +8569,17 @@ void __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDec CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint32_t orig) { LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); @@ -8857,6 +8591,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTra LDKTrustedCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedCommitmentTransaction LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); @@ -8869,6 +8604,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTra return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint32_t o) { + LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8904,6 +8645,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint32_t o) { + LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_SignatureZNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8913,6 +8660,17 @@ void __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_fre CResult_CVec_SignatureZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_clone(uint32_t orig) { LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)(orig & ~1); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); @@ -8924,6 +8682,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecode LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); @@ -8934,12 +8693,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8949,6 +8715,17 @@ void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErro CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); @@ -8960,6 +8737,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvali LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); @@ -8970,12 +8748,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvali LDKInvalidShutdownScript e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = InvalidShutdownScript_clone(&e_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint32_t o) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -8985,6 +8770,17 @@ void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShu CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint32_t arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint32_t orig) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); @@ -9005,6 +8801,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_err(uint3 return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9014,6 +8816,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_free(uint32_t CResult_NoneErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_clone(uint32_t orig) { LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)(orig & ~1); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); @@ -9025,6 +8838,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHop_clone(&o_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv); @@ -9035,12 +8849,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9050,6 +8871,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_fre CResult_RouteHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); @@ -9070,6 +8902,7 @@ void __attribute__((visibility("default"))) TS_CVec_RouteHopZ_free(uint32_tArra LDKRouteHop _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } CVec_RouteHopZ_free(_res_constr); @@ -9097,6 +8930,7 @@ void __attribute__((visibility("default"))) TS_CVec_CVec_RouteHopZZ_free(ptrArr LDKRouteHop _res_conv_12_conv_10_conv; _res_conv_12_conv_10_conv.inner = (void*)(_res_conv_12_conv_10 & (~1)); _res_conv_12_conv_10_conv.is_owned = (_res_conv_12_conv_10 & 1) || (_res_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv); _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv; } _res_constr.data[m] = _res_conv_12_constr; @@ -9108,6 +8942,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_ok LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv); @@ -9118,12 +8953,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_er LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9133,6 +8975,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_free(u CResult_RouteDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = CResult_RouteDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)(orig & ~1); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); @@ -9144,6 +8997,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecod LDKRouteParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteParameters_clone(&o_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv); @@ -9154,12 +9008,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9169,6 +9030,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErr CResult_RouteParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); @@ -9189,6 +9061,7 @@ void __attribute__((visibility("default"))) TS_CVec_RouteHintZ_free(uint32_tArr LDKRouteHint _res_conv_11_conv; _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1)); _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv); _res_constr.data[l] = _res_conv_11_conv; } CVec_RouteHintZ_free(_res_constr); @@ -9217,6 +9090,18 @@ void __attribute__((visibility("default"))) TS_COption_u64Z_free(uint32_t _res) COption_u64Z_free(_res_conv); } +static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_u64Z_clone_ptr(uint32_t arg) { + LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)arg; + int64_t ret_val = COption_u64Z_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_u64Z_clone(uint32_t orig) { LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); @@ -9229,6 +9114,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_ok LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Payee_clone(&o_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv); @@ -9239,12 +9125,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_er LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_PayeeDecodeErrorZ* o_conv = (LDKCResult_PayeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9254,6 +9147,17 @@ void __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_free(u CResult_PayeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); + *ret_conv = CResult_PayeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PayeeDecodeErrorZ* arg_conv = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); @@ -9274,6 +9178,7 @@ void __attribute__((visibility("default"))) TS_CVec_RouteHintHopZ_free(uint32_t LDKRouteHintHop _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } CVec_RouteHintHopZ_free(_res_constr); @@ -9283,6 +9188,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeError LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHint_clone(&o_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv); @@ -9293,12 +9199,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeError LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9308,6 +9221,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_fr CResult_RouteHintDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); @@ -9319,6 +9243,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeEr LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHintHop_clone(&o_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv); @@ -9329,12 +9254,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9344,6 +9276,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); @@ -9364,6 +9307,7 @@ void __attribute__((visibility("default"))) TS_CVec_ChannelDetailsZ_free(uint32 LDKChannelDetails _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } CVec_ChannelDetailsZ_free(_res_constr); @@ -9373,6 +9317,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); @@ -9383,14 +9328,21 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } -void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) { - if ((_res & 1) != 0) return; +jboolean __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_is_ok(uint32_t o) { + LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteLightningErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr); @@ -9398,6 +9350,17 @@ void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_fre CResult_RouteLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_clone(uint32_t orig) { LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); @@ -9422,6 +9385,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_er return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint32_t o) { + LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxOutAccessErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9431,6 +9400,17 @@ void __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_free(u CResult_TxOutAccessErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_clone(uint32_t orig) { LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); @@ -9438,6 +9418,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_cl return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); + int64_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ_clone(uint32_t orig) { LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); @@ -9515,6 +9506,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUp return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint32_t o) { + LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); + jboolean ret_val = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9524,6 +9521,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdate CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); } +static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); + int64_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone(uint32_t orig) { LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); @@ -9577,6 +9585,18 @@ void __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransaction COption_C2Tuple_usizeTransactionZZ_free(_res_conv); } +static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint32_t arg) { + LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; + int64_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_clone(uint32_t orig) { LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); @@ -9585,6 +9605,107 @@ uint32_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransac return ret_ref; } +uint32_t __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_some(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); + o_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)o) & ~1)); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_none() { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); + FREE((void*)_res); + COption_ClosureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_clone_ptr(uint32_t arg) { + LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)arg; + int64_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_ClosureReasonZ_clone(uint32_t orig) { + LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)orig; + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint32_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +jboolean __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + uint32_t __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_some(uint32_t o) { void* o_ptr = (void*)(((uint64_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -9612,6 +9733,18 @@ void __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_free(uint COption_NetworkUpdateZ_free(_res_conv); } +static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) { + LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); + *ret_copy = COption_NetworkUpdateZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_clone_ptr(uint32_t arg) { + LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)arg; + int64_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_clone(uint32_t orig) { LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)orig; LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); @@ -9639,6 +9772,107 @@ void __attribute__((visibility("default"))) TS_CVec_SpendableOutputDescriptorZ_ CVec_SpendableOutputDescriptorZ_free(_res_constr); } +uint32_t __attribute__((visibility("default"))) TS_COption_EventZ_some(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKEvent o_conv = *(LDKEvent*)(o_ptr); + o_conv = Event_clone((LDKEvent*)(((uint64_t)o) & ~1)); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_EventZ_none() { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_EventZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); + FREE((void*)_res); + COption_EventZ_free(_res_conv); +} + +static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_EventZ_clone_ptr(uint32_t arg) { + LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)arg; + int64_t ret_val = COption_EventZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_EventZ_clone(uint32_t orig) { + LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)orig; + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint32_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +jboolean __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + void __attribute__((visibility("default"))) TS_CVec_MessageSendEventZ_free(uint32_tArray _res) { LDKCVec_MessageSendEventZ _res_constr; _res_constr.datalen = *((uint32_t*)_res); @@ -9662,6 +9896,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeEr LDKInitFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InitFeatures_clone(&o_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); @@ -9672,12 +9907,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9691,6 +9933,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeEr LDKNodeFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeFeatures_clone(&o_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); @@ -9701,12 +9944,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9720,6 +9970,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecod LDKChannelFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelFeatures_clone(&o_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); @@ -9730,12 +9981,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9749,6 +10007,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecod LDKInvoiceFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InvoiceFeatures_clone(&o_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); @@ -9759,12 +10018,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9778,6 +10044,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDec LDKScoringParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); @@ -9788,12 +10055,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9807,6 +10081,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_o LDKScorer o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScorer LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv); @@ -9817,12 +10092,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_e LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9836,6 +10118,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutput LDKDelayedPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -9846,12 +10129,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutput LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9861,6 +10151,17 @@ void __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDesc CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(uint32_t orig) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); @@ -9872,6 +10173,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputD LDKStaticPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -9882,12 +10184,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9897,6 +10206,17 @@ void __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescr CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(uint32_t orig) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); @@ -9918,12 +10238,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9933,6 +10260,17 @@ void __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescripto CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone(uint32_t orig) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); @@ -9952,6 +10290,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_err() { return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_is_ok(uint32_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)(o & ~1); + jboolean ret_val = CResult_NoneNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -9961,6 +10305,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_free(uint32_t CResult_NoneNoneZ_free(_res_conv); } +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)(arg & ~1); + int64_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_clone(uint32_t orig) { LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)(orig & ~1); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); @@ -9968,6 +10323,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_clone(uint return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone(uint32_t orig) { LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); @@ -10023,6 +10389,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVe return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint32_t o) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10032,6 +10404,17 @@ void __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_Si CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(uint32_t orig) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); @@ -10054,6 +10437,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_err() return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_is_ok(uint32_t o) { + LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignatureNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10063,6 +10452,17 @@ void __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_free(uint CResult_SignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_clone(uint32_t orig) { LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); @@ -10083,12 +10483,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_err LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SignDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10098,6 +10505,17 @@ void __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_free(ui CResult_SignDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_clone(uint32_t orig) { LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); @@ -10128,6 +10546,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RecoverableSignature return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint32_t o) { + LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10137,6 +10561,17 @@ void __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNone CResult_RecoverableSignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_clone(uint32_t orig) { LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); @@ -10190,6 +10625,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_ return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint32_t o) { + LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10199,6 +10640,17 @@ void __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone(uint32_t orig) { LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); @@ -10210,6 +10662,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecode LDKInMemorySigner o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InMemorySigner_clone(&o_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); @@ -10220,12 +10673,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10235,6 +10695,17 @@ void __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErro CResult_InMemorySignerDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_clone(uint32_t orig) { LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); @@ -10278,6 +10749,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_err return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_is_ok(uint32_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10287,6 +10764,17 @@ void __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_free(ui CResult_TransactionNoneZ_free(_res_conv); } +static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); + int64_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_clone(uint32_t orig) { LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); @@ -10294,6 +10782,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_clo return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); + int64_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone(uint32_t orig) { LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); @@ -10308,6 +10807,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMoni LDKChannelMonitor b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelMonitor_clone(&b_conv); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); @@ -10370,6 +10870,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHa return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(uint32_t o) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10379,6 +10885,17 @@ void __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashCh CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(uint32_t orig) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); @@ -10409,6 +10926,18 @@ void __attribute__((visibility("default"))) TS_COption_u16Z_free(uint32_t _res) COption_u16Z_free(_res_conv); } +static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_u16Z_clone_ptr(uint32_t arg) { + LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; + int64_t ret_val = COption_u16Z_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_u16Z_clone(uint32_t orig) { LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); @@ -10433,6 +10962,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_err(ui return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneAPIErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10442,6 +10977,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_free(uint3 CResult_NoneAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_clone(uint32_t orig) { LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)(orig & ~1); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); @@ -10506,6 +11052,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_err(u return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_is_ok(uint32_t o) { + LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); + jboolean ret_val = CResult__u832APIErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10515,6 +11067,17 @@ void __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_free(uint CResult__u832APIErrorZ_free(_res_conv); } +static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_clone_ptr(uint32_t arg) { + LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); + int64_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_clone(uint32_t orig) { LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); @@ -10541,6 +11104,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSend return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint32_t o) { + LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10550,6 +11119,17 @@ void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFail CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint32_t arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone(uint32_t orig) { LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); @@ -10573,6 +11153,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailu return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint32_t o) { + LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_NonePaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10582,6 +11168,17 @@ void __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_ CResult_NonePaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint32_t arg) { + LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_clone(uint32_t orig) { LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)(orig & ~1); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); @@ -10589,6 +11186,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailu return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone(uint32_t orig) { LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); @@ -10637,6 +11245,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashP return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint32_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10646,6 +11260,17 @@ void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPayme CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint32_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(uint32_t orig) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); @@ -10672,6 +11297,17 @@ void __attribute__((visibility("default"))) TS_CVec_NetAddressZ_free(uint32_tAr CVec_NetAddressZ_free(_res_constr); } +static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone(uint32_t orig) { LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); @@ -10719,6 +11355,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErro return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint32_t o) { + LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10728,6 +11370,17 @@ void __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_f CResult_PaymentSecretAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_clone(uint32_t orig) { LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); @@ -10748,6 +11401,7 @@ void __attribute__((visibility("default"))) TS_CVec_ChannelMonitorZ_free(uint32 LDKChannelMonitor _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } CVec_ChannelMonitorZ_free(_res_constr); @@ -10760,6 +11414,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMana LDKChannelManager b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); // Warning: we need a move here but no clone is available for LDKChannelManager LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); @@ -10789,12 +11444,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashCha LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10808,6 +11470,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeE LDKChannelConfig o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelConfig_clone(&o_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); @@ -10818,12 +11481,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10833,6 +11503,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeError CResult_ChannelConfigDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); @@ -10844,6 +11525,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OutPoint_clone(&o_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); @@ -10854,12 +11536,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OutPointDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10869,6 +11558,17 @@ void __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_fre CResult_OutPointDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_clone(uint32_t orig) { LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); @@ -10902,6 +11602,18 @@ void __attribute__((visibility("default"))) TS_COption_TypeZ_free(uint32_t _res COption_TypeZ_free(_res_conv); } +static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_TypeZ_clone_ptr(uint32_t arg) { + LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; + int64_t ret_val = COption_TypeZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_TypeZ_clone(uint32_t orig) { LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); @@ -10924,12 +11636,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10939,6 +11658,17 @@ void __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeError CResult_COption_TypeZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_clone(uint32_t orig) { LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); @@ -10965,6 +11695,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErro return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_is_ok(uint32_t o) { + LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -10974,6 +11710,17 @@ void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_f CResult_PaymentIdPaymentErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint32_t orig) { LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); @@ -10994,6 +11741,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_err() return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_is_ok(uint32_t o) { + LDKCResult_SiPrefixNoneZ* o_conv = (LDKCResult_SiPrefixNoneZ*)(o & ~1); + jboolean ret_val = CResult_SiPrefixNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11003,6 +11756,17 @@ void __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_free(uint3 CResult_SiPrefixNoneZ_free(_res_conv); } +static inline uint64_t CResult_SiPrefixNoneZ_clone_ptr(LDKCResult_SiPrefixNoneZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); + *ret_conv = CResult_SiPrefixNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_SiPrefixNoneZ* arg_conv = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SiPrefixNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_clone(uint32_t orig) { LDKCResult_SiPrefixNoneZ* orig_conv = (LDKCResult_SiPrefixNoneZ*)(orig & ~1); LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); @@ -11014,6 +11778,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_ok(uint LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); *ret_conv = CResult_InvoiceNoneZ_ok(o_conv); @@ -11026,6 +11791,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_err() { return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_is_ok(uint32_t o) { + LDKCResult_InvoiceNoneZ* o_conv = (LDKCResult_InvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11035,6 +11806,17 @@ void __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_free(uint32 CResult_InvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceNoneZ_clone_ptr(LDKCResult_InvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); + *ret_conv = CResult_InvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_InvoiceNoneZ* arg_conv = (LDKCResult_InvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_clone(uint32_t orig) { LDKCResult_InvoiceNoneZ* orig_conv = (LDKCResult_InvoiceNoneZ*)(orig & ~1); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); @@ -11046,6 +11828,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNone LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = SignedRawInvoice_clone(&o_conv); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); *ret_conv = CResult_SignedRawInvoiceNoneZ_ok(o_conv); @@ -11058,6 +11841,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNone return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_is_ok(uint32_t o) { + LDKCResult_SignedRawInvoiceNoneZ* o_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignedRawInvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11067,6 +11856,17 @@ void __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_fr CResult_SignedRawInvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignedRawInvoiceNoneZ_clone_ptr(LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); + *ret_conv = CResult_SignedRawInvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_clone_ptr(uint32_t arg) { + LDKCResult_SignedRawInvoiceNoneZ* arg_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignedRawInvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_clone(uint32_t orig) { LDKCResult_SignedRawInvoiceNoneZ* orig_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(orig & ~1); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); @@ -11074,6 +11874,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNone return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint32_t arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); + int64_t ret_val = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint32_t orig) { LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); @@ -11085,6 +11896,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = RawInvoice_clone(&a_conv); LDKThirtyTwoBytes b_ref; CHECK(*((uint32_t*)b) == 32); @@ -11092,6 +11904,7 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832Invoi LDKInvoiceSignature c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = InvoiceSignature_clone(&c_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); @@ -11111,6 +11924,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_ok LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PayeePubKey_clone(&o_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); @@ -11124,6 +11938,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_er return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint32_t o) { + LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeePubKeyErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11133,6 +11953,17 @@ void __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_free(u CResult_PayeePubKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_clone(uint32_t orig) { LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); @@ -11153,6 +11984,7 @@ void __attribute__((visibility("default"))) TS_CVec_PrivateRouteZ_free(uint32_t LDKPrivateRoute _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } CVec_PrivateRouteZ_free(_res_constr); @@ -11162,6 +11994,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCre LDKPositiveTimestamp o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PositiveTimestamp_clone(&o_conv); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); @@ -11175,6 +12008,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCre return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11184,6 +12023,17 @@ void __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreatio CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint32_t orig) { LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); @@ -11204,6 +12054,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_e return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11213,6 +12069,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_free( CResult_NoneSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_clone(uint32_t orig) { LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); @@ -11224,6 +12091,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticError LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); @@ -11237,6 +12105,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticError return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint32_t o) { + LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11246,6 +12120,17 @@ void __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_fr CResult_InvoiceSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint32_t orig) { LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); @@ -11257,6 +12142,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DescriptionCreationE LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Description_clone(&o_conv); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); @@ -11270,6 +12156,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DescriptionCreationE return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_DescriptionCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11279,6 +12171,17 @@ void __attribute__((visibility("default"))) TS_CResult_DescriptionCreationError CResult_DescriptionCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_clone(uint32_t orig) { LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); @@ -11290,6 +12193,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationEr LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ExpiryTime_clone(&o_conv); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); *ret_conv = CResult_ExpiryTimeCreationErrorZ_ok(o_conv); @@ -11303,6 +12207,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationEr return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_ExpiryTimeCreationErrorZ* o_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_ExpiryTimeCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11312,6 +12222,17 @@ void __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_ExpiryTimeCreationErrorZ_clone_ptr(LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); + *ret_conv = CResult_ExpiryTimeCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ExpiryTimeCreationErrorZ* arg_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ExpiryTimeCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_clone(uint32_t orig) { LDKCResult_ExpiryTimeCreationErrorZ* orig_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(orig & ~1); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); @@ -11323,6 +12244,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreation LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PrivateRoute_clone(&o_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); @@ -11336,6 +12258,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreation return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11345,6 +12273,17 @@ void __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErro CResult_PrivateRouteCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint32_t orig) { LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); @@ -11366,6 +12305,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_StringErrorZ_err(uin return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_StringErrorZ_is_ok(uint32_t o) { + LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); + jboolean ret_val = CResult_StringErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_StringErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11379,6 +12324,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdate LDKChannelMonitorUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelMonitorUpdate_clone(&o_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); @@ -11389,12 +12335,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdate LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11404,6 +12357,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDeco CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); @@ -11411,10 +12375,112 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdate return (uint64_t)ret_conv; } +uint32_t __attribute__((visibility("default"))) TS_COption_MonitorEventZ_some(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)o) & ~1)); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_MonitorEventZ_none() { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +void __attribute__((visibility("default"))) TS_COption_MonitorEventZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); + FREE((void*)_res); + COption_MonitorEventZ_free(_res_conv); +} + +static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_MonitorEventZ_clone_ptr(uint32_t arg) { + LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; + int64_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_COption_MonitorEventZ_clone(uint32_t orig) { + LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint32_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +jboolean __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint32_t o) { LDKHTLCUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCUpdate_clone(&o_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); @@ -11425,12 +12491,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11440,6 +12513,17 @@ void __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_f CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone(uint32_t orig) { LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); @@ -11457,12 +12541,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErr LDKMonitorUpdateError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = MonitorUpdateError_clone(&e_conv); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11472,6 +12563,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_ CResult_NoneMonitorUpdateErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); + *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_clone(uint32_t orig) { LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); @@ -11479,6 +12581,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErr return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_clone(uint32_t orig) { LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); @@ -11490,6 +12603,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_new( LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKCVec_u8Z b_ref; b_ref.datalen = *((uint32_t*)b); @@ -11509,6 +12623,17 @@ void __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_free(uin C2Tuple_OutPointScriptZ_free(_res_conv); } +static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_clone(uint32_t orig) { LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); @@ -11554,6 +12679,17 @@ void __attribute__((visibility("default"))) TS_CVec_C2Tuple_u32ScriptZZ_free(ui CVec_C2Tuple_u32ScriptZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(uint32_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); @@ -11652,6 +12788,17 @@ void __attribute__((visibility("default"))) TS_CVec_TransactionZ_free(ptrArray CVec_TransactionZ_free(_res_constr); } +static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_clone(uint32_t orig) { LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); @@ -11697,6 +12844,17 @@ void __attribute__((visibility("default"))) TS_CVec_C2Tuple_u32TxOutZZ_free(uin CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(uint32_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); @@ -11789,12 +12947,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashCha LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11804,6 +12969,17 @@ void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannel CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(uint32_t orig) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); @@ -11821,12 +12997,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_ LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_is_ok(uint32_t o) { + LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneLightningErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11836,6 +13019,17 @@ void __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_free CResult_NoneLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_clone(uint32_t orig) { LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); @@ -11843,6 +13037,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_ return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint32_t arg) { + LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint32_t orig) { LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); @@ -11900,12 +13105,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_ LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_is_ok(uint32_t o) { + LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolLightningErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11915,6 +13127,17 @@ void __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_free CResult_boolLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_clone(uint32_t orig) { LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); @@ -11922,6 +13145,17 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_ return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); + return ((uint64_t)ret_conv); +} +int64_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint32_t arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); + int64_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(uint32_t orig) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); @@ -11933,14 +13167,17 @@ uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementC LDKChannelAnnouncement a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = ChannelAnnouncement_clone(&a_conv); LDKChannelUpdate b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelUpdate_clone(&b_conv); LDKChannelUpdate c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = ChannelUpdate_clone(&c_conv); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); @@ -11988,6 +13225,7 @@ void __attribute__((visibility("default"))) TS_CVec_NodeAnnouncementZ_free(uint LDKNodeAnnouncement _res_conv_18_conv; _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); _res_constr.data[s] = _res_conv_18_conv; } CVec_NodeAnnouncementZ_free(_res_constr); @@ -12025,12 +13263,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleEr LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint32_t o) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12040,6 +13285,17 @@ void __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint32_t orig) { LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); @@ -12057,12 +13313,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint32_t o) { + LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_NonePeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12072,6 +13335,17 @@ void __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_fre CResult_NonePeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_clone(uint32_t orig) { LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); @@ -12089,12 +13363,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint32_t o) { + LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12104,6 +13385,17 @@ void __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_fre CResult_boolPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_clone(uint32_t orig) { LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); @@ -12115,6 +13407,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_o LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeId_clone(&o_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); @@ -12125,25 +13418,97 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_e LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +jboolean __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_free(uint32_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_NodeIdDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint32_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint32_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } -void __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_free(uint32_t _res) { +jboolean __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NodeIdDecodeErrorZ_free(_res_conv); + CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); } -uint32_t __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint32_t orig) { - LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); +static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone(uint32_t orig) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); return (uint64_t)ret_conv; } @@ -12177,6 +13542,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelIn LDKDirectionalChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DirectionalChannelInfo_clone(&o_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_ok(o_conv); @@ -12187,12 +13553,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelIn LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* o_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12202,6 +13575,17 @@ void __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDe CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); + *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone(uint32_t orig) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); @@ -12213,6 +13597,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErr LDKChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelInfo_clone(&o_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); @@ -12223,12 +13608,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12238,6 +13630,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_ CResult_ChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); @@ -12249,6 +13652,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErr LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RoutingFees_clone(&o_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); @@ -12259,12 +13663,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12274,6 +13685,17 @@ void __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_ CResult_RoutingFeesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); @@ -12285,6 +13707,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfo LDKNodeAnnouncementInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncementInfo_clone(&o_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); @@ -12295,12 +13718,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfo LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12310,6 +13740,17 @@ void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDeco CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); @@ -12336,6 +13777,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ LDKNodeInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeInfo_clone(&o_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); @@ -12346,12 +13788,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12361,6 +13810,17 @@ void __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_fre CResult_NodeInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); @@ -12372,6 +13832,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeEr LDKNetworkGraph o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NetworkGraph_clone(&o_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); @@ -12382,12 +13843,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12397,6 +13865,17 @@ void __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); @@ -12442,6 +13921,18 @@ void __attribute__((visibility("default"))) TS_COption_CVec_NetAddressZZ_free(u COption_CVec_NetAddressZZ_free(_res_conv); } +static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint32_t arg) { + LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; + int64_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_COption_CVec_NetAddressZZ_clone(uint32_t orig) { LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); @@ -12464,12 +13955,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetAddressDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12479,6 +13977,17 @@ void __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_f CResult_NetAddressDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); @@ -12499,6 +14008,7 @@ void __attribute__((visibility("default"))) TS_CVec_UpdateAddHTLCZ_free(uint32_ LDKUpdateAddHTLC _res_conv_15_conv; _res_conv_15_conv.inner = (void*)(_res_conv_15 & (~1)); _res_conv_15_conv.is_owned = (_res_conv_15 & 1) || (_res_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv); _res_constr.data[p] = _res_conv_15_conv; } CVec_UpdateAddHTLCZ_free(_res_constr); @@ -12517,6 +14027,7 @@ void __attribute__((visibility("default"))) TS_CVec_UpdateFulfillHTLCZ_free(uin LDKUpdateFulfillHTLC _res_conv_19_conv; _res_conv_19_conv.inner = (void*)(_res_conv_19 & (~1)); _res_conv_19_conv.is_owned = (_res_conv_19 & 1) || (_res_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); _res_constr.data[t] = _res_conv_19_conv; } CVec_UpdateFulfillHTLCZ_free(_res_constr); @@ -12535,6 +14046,7 @@ void __attribute__((visibility("default"))) TS_CVec_UpdateFailHTLCZ_free(uint32 LDKUpdateFailHTLC _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } CVec_UpdateFailHTLCZ_free(_res_constr); @@ -12553,6 +14065,7 @@ void __attribute__((visibility("default"))) TS_CVec_UpdateFailMalformedHTLCZ_fr LDKUpdateFailMalformedHTLC _res_conv_25_conv; _res_conv_25_conv.inner = (void*)(_res_conv_25 & (~1)); _res_conv_25_conv.is_owned = (_res_conv_25 & 1) || (_res_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv); _res_constr.data[z] = _res_conv_25_conv; } CVec_UpdateFailMalformedHTLCZ_free(_res_constr); @@ -12562,6 +14075,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeE LDKAcceptChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AcceptChannel_clone(&o_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv); @@ -12572,12 +14086,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12587,6 +14108,17 @@ void __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeError CResult_AcceptChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint32_t orig) { LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(orig & ~1); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); @@ -12598,6 +14130,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_AnnouncementSignatur LDKAnnouncementSignatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AnnouncementSignatures_clone(&o_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv); @@ -12608,12 +14141,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_AnnouncementSignatur LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12623,6 +14163,17 @@ void __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDe CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint32_t orig) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(orig & ~1); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); @@ -12634,6 +14185,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDe LDKChannelReestablish o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelReestablish_clone(&o_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); @@ -12644,12 +14196,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDe LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12659,6 +14218,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecode CResult_ChannelReestablishDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); @@ -12670,6 +14240,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeE LDKClosingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSigned_clone(&o_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv); @@ -12680,12 +14251,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12695,6 +14273,17 @@ void __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeError CResult_ClosingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); @@ -12706,6 +14295,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRang LDKClosingSignedFeeRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSignedFeeRange_clone(&o_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv); @@ -12716,12 +14306,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRang LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12731,6 +14328,17 @@ void __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDec CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); @@ -12742,6 +14350,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDeco LDKCommitmentSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentSigned_clone(&o_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv); @@ -12752,12 +14361,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12767,6 +14383,17 @@ void __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeEr CResult_CommitmentSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); @@ -12778,6 +14405,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecode LDKFundingCreated o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingCreated_clone(&o_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv); @@ -12788,12 +14416,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12803,6 +14438,17 @@ void __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErro CResult_FundingCreatedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); @@ -12814,6 +14460,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeE LDKFundingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingSigned_clone(&o_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); @@ -12824,12 +14471,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12839,6 +14493,17 @@ void __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeError CResult_FundingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); @@ -12850,6 +14515,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeE LDKFundingLocked o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingLocked_clone(&o_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); @@ -12860,12 +14526,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_FundingLockedDecodeErrorZ* o_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingLockedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12875,6 +14548,17 @@ void __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeError CResult_FundingLockedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); + *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_clone(uint32_t orig) { LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); @@ -12886,6 +14570,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_ok( LDKInit o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Init_clone(&o_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); @@ -12896,12 +14581,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_err LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12911,6 +14603,17 @@ void __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_free(ui CResult_InitDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_clone(uint32_t orig) { LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)(orig & ~1); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); @@ -12922,6 +14625,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErr LDKOpenChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OpenChannel_clone(&o_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); @@ -12932,12 +14636,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12947,6 +14658,17 @@ void __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_ CResult_OpenChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint32_t orig) { LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(orig & ~1); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); @@ -12958,6 +14680,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeEr LDKRevokeAndACK o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RevokeAndACK_clone(&o_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); @@ -12968,12 +14691,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12983,6 +14713,17 @@ void __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint32_t orig) { LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(orig & ~1); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); @@ -12994,6 +14735,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ LDKShutdown o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Shutdown_clone(&o_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); @@ -13004,12 +14746,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13019,6 +14768,17 @@ void __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_fre CResult_ShutdownDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); @@ -13030,6 +14790,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecode LDKUpdateFailHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailHTLC_clone(&o_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); @@ -13040,12 +14801,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13055,6 +14823,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErro CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); @@ -13066,6 +14845,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedH LDKUpdateFailMalformedHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailMalformedHTLC_clone(&o_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv); @@ -13076,12 +14856,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedH LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13091,6 +14878,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCD CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); @@ -13102,6 +14900,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeError LDKUpdateFee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFee_clone(&o_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv); @@ -13112,12 +14911,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeError LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13127,6 +14933,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_fr CResult_UpdateFeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); + *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); @@ -13138,6 +14955,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDec LDKUpdateFulfillHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFulfillHTLC_clone(&o_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv); @@ -13148,12 +14966,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13163,6 +14988,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeE CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); @@ -13174,6 +15010,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeE LDKUpdateAddHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateAddHTLC_clone(&o_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv); @@ -13184,12 +15021,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13199,6 +15043,17 @@ void __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeError CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); @@ -13210,6 +15065,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_ok( LDKPing o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Ping_clone(&o_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv); @@ -13220,12 +15076,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_err LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PingDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13235,6 +15098,17 @@ void __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_free(ui CResult_PingDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = CResult_PingDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_clone(uint32_t orig) { LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)(orig & ~1); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); @@ -13246,6 +15120,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_ok( LDKPong o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Pong_clone(&o_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv); @@ -13256,12 +15131,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_err LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PongDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13271,6 +15153,17 @@ void __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_free(ui CResult_PongDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = CResult_PongDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_clone(uint32_t orig) { LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)(orig & ~1); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); @@ -13282,6 +15175,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnou LDKUnsignedChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelAnnouncement_clone(&o_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -13292,12 +15186,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnou LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13307,6 +15208,17 @@ void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncem CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); @@ -13318,6 +15230,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementD LDKChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelAnnouncement_clone(&o_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -13328,12 +15241,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13343,6 +15263,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecod CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); @@ -13354,6 +15285,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdat LDKUnsignedChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelUpdate_clone(&o_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv); @@ -13364,12 +15296,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdat LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13379,6 +15318,17 @@ void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDec CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); @@ -13390,6 +15340,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeE LDKChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelUpdate_clone(&o_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv); @@ -13400,12 +15351,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13415,6 +15373,17 @@ void __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeError CResult_ChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); @@ -13426,6 +15395,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeEr LDKErrorMessage o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ErrorMessage_clone(&o_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv); @@ -13436,12 +15406,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13451,6 +15428,17 @@ void __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(orig & ~1); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); @@ -13462,6 +15450,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnounce LDKUnsignedNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedNodeAnnouncement_clone(&o_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -13472,12 +15461,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnounce LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13487,6 +15483,17 @@ void __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(uint32_t orig) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); @@ -13498,6 +15505,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDeco LDKNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncement_clone(&o_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -13508,12 +15516,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13523,6 +15538,17 @@ void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeEr CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone(uint32_t orig) { LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); @@ -13534,6 +15560,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIds LDKQueryShortChannelIds o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryShortChannelIds_clone(&o_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv); @@ -13544,12 +15571,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIds LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13559,6 +15593,17 @@ void __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDeco CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone(uint32_t orig) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(orig & ~1); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); @@ -13570,6 +15615,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIds LDKReplyShortChannelIdsEnd o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyShortChannelIdsEnd_clone(&o_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv); @@ -13580,12 +15626,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIds LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13595,6 +15648,17 @@ void __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndD CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); @@ -13606,6 +15670,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDec LDKQueryChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryChannelRange_clone(&o_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv); @@ -13616,12 +15681,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13631,6 +15703,17 @@ void __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeE CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); @@ -13642,6 +15725,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDec LDKReplyChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyChannelRange_clone(&o_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv); @@ -13652,12 +15736,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13667,6 +15758,17 @@ void __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeE CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone(uint32_t orig) { LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); @@ -13678,6 +15780,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilte LDKGossipTimestampFilter o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = GossipTimestampFilter_clone(&o_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv); @@ -13688,12 +15791,19 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilte LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint32_t o) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13703,6 +15813,17 @@ void __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDec CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone(uint32_t orig) { LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(orig & ~1); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); @@ -13714,6 +15835,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreatio LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv); @@ -13730,6 +15852,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreatio return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint32_t o) { + LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13739,6 +15867,17 @@ void __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErr CResult_InvoiceSignOrCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +int64_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint32_t arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint32_t orig) { LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(orig & ~1); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); @@ -13776,6 +15915,7 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitor LDKLockedChannelMonitor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKLockedChannelMonitor LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); @@ -13788,6 +15928,12 @@ uint32_t __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitor return (uint64_t)ret_conv; } +jboolean __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint32_t o) { + LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)(o & ~1); + jboolean ret_val = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); + return ret_val; +} + void __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13810,6 +15956,7 @@ void __attribute__((visibility("default"))) TS_CVec_OutPointZ_free(uint32_tArra LDKOutPoint _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } CVec_OutPointZ_free(_res_constr); @@ -13824,6 +15971,18 @@ void __attribute__((visibility("default"))) TS_PaymentPurpose_free(uint32_t thi PaymentPurpose_free(this_ptr_conv); } +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PaymentPurpose_clone_ptr(uint32_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)arg; + int64_t ret_val = PaymentPurpose_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PaymentPurpose_clone(uint32_t orig) { LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig; LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); @@ -13864,6 +16023,18 @@ void __attribute__((visibility("default"))) TS_ClosureReason_free(uint32_t this ClosureReason_free(this_ptr_conv); } +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ClosureReason_clone_ptr(uint32_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)arg; + int64_t ret_val = ClosureReason_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ClosureReason_clone(uint32_t orig) { LDKClosureReason* orig_conv = (LDKClosureReason*)orig; LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); @@ -13932,6 +16103,15 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosureReason_write(uint3 return ret_arr; } +uint32_t __attribute__((visibility("default"))) TS_ClosureReason_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = *((uint32_t*)ser); + ser_ref.data = (int8_t*)(ser + 4); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + return (uint64_t)ret_conv; +} + void __attribute__((visibility("default"))) TS_Event_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -13941,6 +16121,18 @@ void __attribute__((visibility("default"))) TS_Event_free(uint32_t this_ptr) { Event_free(this_ptr_conv); } +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Event_clone_ptr(uint32_t arg) { + LDKEvent* arg_conv = (LDKEvent*)arg; + int64_t ret_val = Event_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Event_clone(uint32_t orig) { LDKEvent* orig_conv = (LDKEvent*)orig; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); @@ -14020,6 +16212,7 @@ uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_failed(in LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -14030,6 +16223,7 @@ uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_failed(in LDKRouteParameters retry_conv; retry_conv.inner = (void*)(retry & (~1)); retry_conv.is_owned = (retry & 1) || (retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv); retry_conv = RouteParameters_clone(&retry_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv); @@ -14115,6 +16309,15 @@ int8_tArray __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) return ret_arr; } +uint32_t __attribute__((visibility("default"))) TS_Event_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = *((uint32_t*)ser); + ser_ref.data = (int8_t*)(ser + 4); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + return (uint64_t)ret_conv; +} + void __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -14124,6 +16327,18 @@ void __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t t MessageSendEvent_free(this_ptr_conv); } +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MessageSendEvent_clone_ptr(uint32_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)arg; + int64_t ret_val = MessageSendEvent_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_clone(uint32_t orig) { LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig; LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); @@ -14139,6 +16354,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_accept LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AcceptChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); @@ -14153,6 +16369,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_open_c LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = OpenChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); @@ -14167,6 +16384,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_fundin LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingCreated_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); @@ -14181,6 +16399,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_fundin LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); @@ -14195,6 +16414,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_fundin LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingLocked_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); @@ -14209,6 +16429,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_announ LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AnnouncementSignatures_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); @@ -14223,6 +16444,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_update_htlc LDKCommitmentUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = (updates & 1) || (updates == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); updates_conv = CommitmentUpdate_clone(&updates_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); @@ -14237,6 +16459,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_revoke LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = RevokeAndACK_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); @@ -14251,6 +16474,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_closin LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ClosingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); @@ -14265,6 +16489,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_shutdo LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = Shutdown_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); @@ -14279,6 +16504,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_channe LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelReestablish_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); @@ -14290,10 +16516,12 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_c LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelAnnouncement_clone(&msg_conv); LDKChannelUpdate update_msg_conv; update_msg_conv.inner = (void*)(update_msg & (~1)); update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); update_msg_conv = ChannelUpdate_clone(&update_msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); @@ -14305,6 +16533,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_n LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = NodeAnnouncement_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); @@ -14316,6 +16545,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_c LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); @@ -14330,6 +16560,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_channe LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); @@ -14358,6 +16589,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_channe LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); @@ -14372,6 +16604,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_short_ LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); @@ -14386,6 +16619,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageSendEvent_send_reply_ LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); @@ -14429,6 +16663,18 @@ void __attribute__((visibility("default"))) TS_APIError_free(uint32_t this_ptr) APIError_free(this_ptr_conv); } +static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_APIError_clone_ptr(uint32_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)arg; + int64_t ret_val = APIError_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_APIError_clone(uint32_t orig) { LDKAPIError* orig_conv = (LDKAPIError*)orig; LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); @@ -14480,6 +16726,7 @@ uint32_t __attribute__((visibility("default"))) TS_APIError_incompatible_shutdo LDKShutdownScript script_conv; script_conv.inner = (void*)(script & (~1)); script_conv.is_owned = (script & 1) || (script == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); script_conv = ShutdownScript_clone(&script_conv); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_incompatible_shutdown_script(script_conv); @@ -14571,6 +16818,147 @@ uint32_t __attribute__((visibility("default"))) TS_Level_max() { return ret_conv; } +void __attribute__((visibility("default"))) TS_Record_free(uint32_t this_obj) { + LDKRecord this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Record_free(this_obj_conv); +} + +uint32_t __attribute__((visibility("default"))) TS_Record_get_level(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + uint32_t ret_conv = LDKLevel_to_js(Record_get_level(&this_ptr_conv)); + return ret_conv; +} + +void __attribute__((visibility("default"))) TS_Record_set_level(uint32_t this_ptr, uint32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKLevel val_conv = LDKLevel_from_js(val); + Record_set_level(&this_ptr_conv, val_conv); +} + +jstring __attribute__((visibility("default"))) TS_Record_get_args(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_args(&this_ptr_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void __attribute__((visibility("default"))) TS_Record_set_args(uint32_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_args(&this_ptr_conv, val_conv); +} + +jstring __attribute__((visibility("default"))) TS_Record_get_module_path(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&this_ptr_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void __attribute__((visibility("default"))) TS_Record_set_module_path(uint32_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_module_path(&this_ptr_conv, val_conv); +} + +jstring __attribute__((visibility("default"))) TS_Record_get_file(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_file(&this_ptr_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +void __attribute__((visibility("default"))) TS_Record_set_file(uint32_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = str_ref_to_owned_c(val); + Record_set_file(&this_ptr_conv, val_conv); +} + +int32_t __attribute__((visibility("default"))) TS_Record_get_line(uint32_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_val = Record_get_line(&this_ptr_conv); + return ret_val; +} + +void __attribute__((visibility("default"))) TS_Record_set_line(uint32_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Record_set_line(&this_ptr_conv, val); +} + +static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Record_clone_ptr(uint32_t arg) { + LDKRecord arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Record_clone_ptr(&arg_conv); + return ret_val; +} + +uint32_t __attribute__((visibility("default"))) TS_Record_clone(uint32_t orig) { + LDKRecord orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKRecord ret_var = Record_clone(&orig_conv); + uint64_t ret_ref = 0; + CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + void __attribute__((visibility("default"))) TS_Logger_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -14584,6 +16972,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_free(uint LDKChannelHandshakeConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeConfig_free(this_obj_conv); } @@ -14591,6 +16980,7 @@ int32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_get_mi LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -14599,6 +16989,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_set_minim LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } @@ -14606,6 +16997,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_get_ou LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); return ret_val; } @@ -14614,6 +17006,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_set_our_t LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); } @@ -14621,6 +17014,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_get_ou LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -14629,6 +17023,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_set_our_h LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } @@ -14637,6 +17032,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_new(i uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14644,14 +17040,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_new(i return ret_ref; } +static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_clone_ptr(uint32_t arg) { + LDKChannelHandshakeConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_clone(uint32_t orig) { LDKChannelHandshakeConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14664,6 +17083,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_defau uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14675,6 +17095,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_free(uint LDKChannelHandshakeLimits this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeLimits_free(this_obj_conv); } @@ -14682,6 +17103,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_mi LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -14690,6 +17112,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_min_f LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); } @@ -14697,6 +17120,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_ma LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -14705,6 +17129,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_max_h LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); } @@ -14712,6 +17137,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_mi LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -14720,6 +17146,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_min_m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -14727,6 +17154,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_ma LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -14735,6 +17163,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_max_c LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -14742,6 +17171,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_mi LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -14750,6 +17180,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_min_m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); } @@ -14757,6 +17188,7 @@ int32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_ma LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); return ret_val; } @@ -14765,6 +17197,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_max_m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); } @@ -14772,6 +17205,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_f LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); return ret_val; } @@ -14780,6 +17214,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_force LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); } @@ -14787,6 +17222,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_get_th LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); return ret_val; } @@ -14795,6 +17231,7 @@ void __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_set_their LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); } @@ -14803,6 +17240,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_new(i uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14810,14 +17248,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_new(i return ret_ref; } +static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_clone_ptr(uint32_t arg) { + LDKChannelHandshakeLimits arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_clone(uint32_t orig) { LDKChannelHandshakeLimits orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14830,6 +17291,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_defau uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14841,6 +17303,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_free(uint32_t this LDKChannelConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelConfig_free(this_obj_conv); } @@ -14848,6 +17311,7 @@ int32_t __attribute__((visibility("default"))) TS_ChannelConfig_get_forwarding_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -14856,6 +17320,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_forwarding_fee LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); } @@ -14863,6 +17328,7 @@ int32_t __attribute__((visibility("default"))) TS_ChannelConfig_get_forwarding_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -14871,6 +17337,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_forwarding_fee LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } @@ -14878,6 +17345,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelConfig_get_cltv_expiry LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -14886,6 +17354,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_cltv_expiry_de LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -14893,6 +17362,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelConfig_get_announced_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_announced_channel(&this_ptr_conv); return ret_val; } @@ -14901,6 +17371,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_announced_chan LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_announced_channel(&this_ptr_conv, val); } @@ -14908,6 +17379,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelConfig_get_commit_upf LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); return ret_val; } @@ -14916,6 +17388,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_commit_upfront LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } @@ -14923,6 +17396,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelConfig_get_max_dust_ht LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); return ret_val; } @@ -14931,6 +17405,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_max_dust_htlc_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); } @@ -14938,6 +17413,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelConfig_get_force_close LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -14946,6 +17422,7 @@ void __attribute__((visibility("default"))) TS_ChannelConfig_set_force_close_av LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); } @@ -14954,6 +17431,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t fo uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14961,14 +17439,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t fo return ret_ref; } +static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelConfig_clone_ptr(uint32_t arg) { + LDKChannelConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelConfig_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_clone(uint32_t orig) { LDKChannelConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14981,6 +17482,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_default() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -14992,6 +17494,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelConfig_write(uint3 LDKChannelConfig obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15012,6 +17515,7 @@ void __attribute__((visibility("default"))) TS_UserConfig_free(uint32_t this_ob LDKUserConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UserConfig_free(this_obj_conv); } @@ -15019,10 +17523,12 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_get_own_channel_c LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15034,9 +17540,11 @@ void __attribute__((visibility("default"))) TS_UserConfig_set_own_channel_confi LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeConfig_clone(&val_conv); UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); } @@ -15045,10 +17553,12 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_get_peer_channel_ LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15060,9 +17570,11 @@ void __attribute__((visibility("default"))) TS_UserConfig_set_peer_channel_conf LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeLimits_clone(&val_conv); UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); } @@ -15071,10 +17583,12 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_get_channel_optio LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15086,9 +17600,11 @@ void __attribute__((visibility("default"))) TS_UserConfig_set_channel_options(u LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelConfig_clone(&val_conv); UserConfig_set_channel_options(&this_ptr_conv, val_conv); } @@ -15097,6 +17613,7 @@ jboolean __attribute__((visibility("default"))) TS_UserConfig_get_accept_forwar LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); return ret_val; } @@ -15105,6 +17622,7 @@ void __attribute__((visibility("default"))) TS_UserConfig_set_accept_forwards_t LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); } @@ -15112,19 +17630,23 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_ LDKChannelHandshakeConfig own_channel_config_arg_conv; own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); LDKChannelConfig channel_options_arg_conv; channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15132,14 +17654,37 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_ return ret_ref; } +static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UserConfig_clone_ptr(uint32_t arg) { + LDKUserConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UserConfig_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UserConfig_clone(uint32_t orig) { LDKUserConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUserConfig ret_var = UserConfig_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15152,6 +17697,7 @@ uint32_t __attribute__((visibility("default"))) TS_UserConfig_default() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15163,17 +17709,41 @@ void __attribute__((visibility("default"))) TS_BestBlock_free(uint32_t this_obj LDKBestBlock this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BestBlock_free(this_obj_conv); } +static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_BestBlock_clone_ptr(uint32_t arg) { + LDKBestBlock arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BestBlock_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_BestBlock_clone(uint32_t orig) { LDKBestBlock orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBestBlock ret_var = BestBlock_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15187,6 +17757,7 @@ uint32_t __attribute__((visibility("default"))) TS_BestBlock_from_genesis(uint3 uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15202,6 +17773,7 @@ uint32_t __attribute__((visibility("default"))) TS_BestBlock_new(int8_tArray bl uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15213,6 +17785,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BestBlock_block_hash(uint LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), BestBlock_block_hash(&this_arg_conv).data, 32); return ret_arr; @@ -15222,6 +17795,7 @@ int32_t __attribute__((visibility("default"))) TS_BestBlock_height(uint32_t thi LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = BestBlock_height(&this_arg_conv); return ret_val; } @@ -15307,6 +17881,7 @@ void __attribute__((visibility("default"))) TS_WatchedOutput_free(uint32_t this LDKWatchedOutput this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); WatchedOutput_free(this_obj_conv); } @@ -15314,6 +17889,7 @@ int8_tArray __attribute__((visibility("default"))) TS_WatchedOutput_get_block_h LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), WatchedOutput_get_block_hash(&this_ptr_conv).data, 32); return ret_arr; @@ -15323,6 +17899,7 @@ void __attribute__((visibility("default"))) TS_WatchedOutput_set_block_hash(uin LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -15333,10 +17910,12 @@ uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_get_outpoint(u LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15348,9 +17927,11 @@ void __attribute__((visibility("default"))) TS_WatchedOutput_set_outpoint(uint3 LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); } @@ -15359,6 +17940,7 @@ int8_tArray __attribute__((visibility("default"))) TS_WatchedOutput_get_script_ LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15369,6 +17951,7 @@ void __attribute__((visibility("default"))) TS_WatchedOutput_set_script_pubkey( LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = *((uint32_t*)val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -15383,6 +17966,7 @@ uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_new(int8_tArra LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKCVec_u8Z script_pubkey_arg_ref; script_pubkey_arg_ref.datalen = *((uint32_t*)script_pubkey_arg); @@ -15392,6 +17976,7 @@ uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_new(int8_tArra uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15399,14 +17984,37 @@ uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_new(int8_tArra return ret_ref; } +static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_WatchedOutput_clone_ptr(uint32_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = WatchedOutput_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_WatchedOutput_clone(uint32_t orig) { LDKWatchedOutput orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15418,6 +18026,7 @@ int64_t __attribute__((visibility("default"))) TS_WatchedOutput_hash(uint32_t o LDKWatchedOutput o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = WatchedOutput_hash(&o_conv); return ret_val; } @@ -15472,17 +18081,41 @@ void __attribute__((visibility("default"))) TS_MonitorUpdateId_free(uint32_t th LDKMonitorUpdateId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateId_free(this_obj_conv); } +static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MonitorUpdateId_clone_ptr(uint32_t arg) { + LDKMonitorUpdateId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateId_clone(uint32_t orig) { LDKMonitorUpdateId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15494,6 +18127,7 @@ int64_t __attribute__((visibility("default"))) TS_MonitorUpdateId_hash(uint32_t LDKMonitorUpdateId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MonitorUpdateId_hash(&o_conv); return ret_val; } @@ -15502,9 +18136,11 @@ jboolean __attribute__((visibility("default"))) TS_MonitorUpdateId_eq(uint32_t LDKMonitorUpdateId a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMonitorUpdateId b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv); return ret_val; } @@ -15522,6 +18158,7 @@ void __attribute__((visibility("default"))) TS_LockedChannelMonitor_free(uint32 LDKLockedChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockedChannelMonitor_free(this_obj_conv); } @@ -15529,6 +18166,7 @@ void __attribute__((visibility("default"))) TS_ChainMonitor_free(uint32_t this_ LDKChainMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainMonitor_free(this_obj_conv); } @@ -15556,6 +18194,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_new(uint32_t ch uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15567,6 +18206,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChainMonitor_get_claima LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ignored_channels_constr; ignored_channels_constr.datalen = *((uint32_t*)ignored_channels); if (ignored_channels_constr.datalen > 0) @@ -15579,6 +18219,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChainMonitor_get_claima LDKChannelDetails ignored_channels_conv_16_conv; ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; } @@ -15601,9 +18242,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_get_monitor(uin LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); @@ -15614,6 +18257,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChainMonitor_list_monit LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -15623,6 +18267,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChainMonitor_list_monit uint64_t ret_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner; if (ret_conv_10_var.is_owned) { ret_conv_10_ref |= 1; @@ -15638,13 +18283,16 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_channel_monitor LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorUpdateId completed_update_id_conv; completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); @@ -15655,6 +18303,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_Listen(uint3 LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -15664,6 +18313,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_Confirm(uint LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -15673,6 +18323,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_Watch(uint32 LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); return (uint64_t)ret_ret; @@ -15682,6 +18333,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_EventsProvid LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -15691,6 +18343,7 @@ void __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_free(uint32 LDKChannelMonitorUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitorUpdate_free(this_obj_conv); } @@ -15698,6 +18351,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_get_upda LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); return ret_val; } @@ -15706,17 +18360,41 @@ void __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_set_update_ LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } +static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_clone_ptr(uint32_t arg) { + LDKChannelMonitorUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_clone(uint32_t orig) { LDKChannelMonitorUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15728,6 +18406,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_writ LDKChannelMonitorUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15748,6 +18427,7 @@ void __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t LDKMonitorUpdateError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateError_free(this_obj_conv); } @@ -15755,6 +18435,7 @@ jstring __attribute__((visibility("default"))) TS_MonitorUpdateError_get_a(uint LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -15765,6 +18446,7 @@ void __attribute__((visibility("default"))) TS_MonitorUpdateError_set_a(uint32_ LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = str_ref_to_owned_c(val); MonitorUpdateError_set_a(&this_ptr_conv, val_conv); } @@ -15775,6 +18457,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_new(jstri uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15782,14 +18465,37 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_new(jstri return ret_ref; } +static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) { + LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone_ptr(uint32_t arg) { + LDKMonitorUpdateError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone(uint32_t orig) { LDKMonitorUpdateError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15806,6 +18512,18 @@ void __attribute__((visibility("default"))) TS_MonitorEvent_free(uint32_t this_ MonitorEvent_free(this_ptr_conv); } +static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MonitorEvent_clone_ptr(uint32_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; + int64_t ret_val = MonitorEvent_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_clone(uint32_t orig) { LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); @@ -15818,6 +18536,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_htlcevent(uint3 LDKHTLCUpdate a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = HTLCUpdate_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_htlcevent(a_conv); @@ -15829,6 +18548,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_commitment_tx_c LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); @@ -15840,6 +18560,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_update_complete LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); @@ -15851,6 +18572,7 @@ uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_update_failed(u LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_failed(a_conv); @@ -15867,21 +18589,54 @@ int8_tArray __attribute__((visibility("default"))) TS_MonitorEvent_write(uint32 return ret_arr; } +uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = *((uint32_t*)ser); + ser_ref.data = (int8_t*)(ser + 4); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + return (uint64_t)ret_conv; +} + void __attribute__((visibility("default"))) TS_HTLCUpdate_free(uint32_t this_obj) { LDKHTLCUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCUpdate_free(this_obj_conv); } +static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_HTLCUpdate_clone_ptr(uint32_t arg) { + LDKHTLCUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_HTLCUpdate_clone(uint32_t orig) { LDKHTLCUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15893,6 +18648,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HTLCUpdate_write(uint32_t LDKHTLCUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15918,6 +18674,18 @@ void __attribute__((visibility("default"))) TS_Balance_free(uint32_t this_ptr) Balance_free(this_ptr_conv); } +static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Balance_clone_ptr(uint32_t arg) { + LDKBalance* arg_conv = (LDKBalance*)arg; + int64_t ret_val = Balance_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Balance_clone(uint32_t orig) { LDKBalance* orig_conv = (LDKBalance*)orig; LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); @@ -15965,17 +18733,41 @@ void __attribute__((visibility("default"))) TS_ChannelMonitor_free(uint32_t thi LDKChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitor_free(this_obj_conv); } +static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelMonitor_clone_ptr(uint32_t arg) { + LDKChannelMonitor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_clone(uint32_t orig) { LDKChannelMonitor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -15987,6 +18779,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_write(uint LDKChannelMonitor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -15998,9 +18791,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_update_monito LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMonitorUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; @@ -16019,6 +18814,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelMonitor_get_latest_upd LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ChannelMonitor_get_latest_update_id(&this_arg_conv); return ret_val; } @@ -16027,6 +18823,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_get_funding_t LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); return ((uint64_t)ret_conv); @@ -16036,6 +18833,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_outp LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -16054,6 +18852,7 @@ void __attribute__((visibility("default"))) TS_ChannelMonitor_load_outputs_to_w LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* filter_ptr = (void*)(((uint64_t)filter) & ~1); if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } LDKFilter* filter_conv = (LDKFilter*)filter_ptr; @@ -16064,6 +18863,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_and_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -16083,6 +18883,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_and_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -16102,6 +18903,7 @@ ptrArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_latest_ho LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; @@ -16125,6 +18927,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_block_co LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -16171,6 +18974,7 @@ void __attribute__((visibility("default"))) TS_ChannelMonitor_block_disconnecte LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -16191,6 +18995,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_transact LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -16237,6 +19042,7 @@ void __attribute__((visibility("default"))) TS_ChannelMonitor_transaction_uncon LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char txid_arr[32]; CHECK(*((uint32_t*)txid) == 32); memcpy(txid_arr, (uint8_t*)(txid + 4), 32); @@ -16257,6 +19063,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_best_blo LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(*((uint32_t*)header) == 80); memcpy(header_arr, (uint8_t*)(header + 4), 80); @@ -16288,6 +19095,7 @@ ptrArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_relevant_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); ptrArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes"); @@ -16306,10 +19114,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_current_best_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16321,6 +19131,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelMonitor_get_clai LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -16352,6 +19163,7 @@ void __attribute__((visibility("default"))) TS_OutPoint_free(uint32_t this_obj) LDKOutPoint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OutPoint_free(this_obj_conv); } @@ -16359,6 +19171,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OutPoint_get_txid(uint32_ LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *OutPoint_get_txid(&this_ptr_conv), 32); return ret_arr; @@ -16368,6 +19181,7 @@ void __attribute__((visibility("default"))) TS_OutPoint_set_txid(uint32_t this_ LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -16378,6 +19192,7 @@ int16_t __attribute__((visibility("default"))) TS_OutPoint_get_index(uint32_t t LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OutPoint_get_index(&this_ptr_conv); return ret_val; } @@ -16386,6 +19201,7 @@ void __attribute__((visibility("default"))) TS_OutPoint_set_index(uint32_t this LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OutPoint_set_index(&this_ptr_conv, val); } @@ -16397,6 +19213,7 @@ uint32_t __attribute__((visibility("default"))) TS_OutPoint_new(int8_tArray txi uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16404,14 +19221,37 @@ uint32_t __attribute__((visibility("default"))) TS_OutPoint_new(int8_tArray txi return ret_ref; } +static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_OutPoint_clone_ptr(uint32_t arg) { + LDKOutPoint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OutPoint_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_OutPoint_clone(uint32_t orig) { LDKOutPoint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOutPoint ret_var = OutPoint_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16423,9 +19263,11 @@ jboolean __attribute__((visibility("default"))) TS_OutPoint_eq(uint32_t a, uint LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKOutPoint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = OutPoint_eq(&a_conv, &b_conv); return ret_val; } @@ -16434,6 +19276,7 @@ int64_t __attribute__((visibility("default"))) TS_OutPoint_hash(uint32_t o) { LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = OutPoint_hash(&o_conv); return ret_val; } @@ -16442,6 +19285,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OutPoint_to_channel_id(ui LDKOutPoint this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OutPoint_to_channel_id(&this_arg_conv).data, 32); return ret_arr; @@ -16451,6 +19295,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OutPoint_write(uint32_t o LDKOutPoint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -16471,6 +19316,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_f LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DelayedPaymentOutputDescriptor_free(this_obj_conv); } @@ -16478,10 +19324,12 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16493,9 +19341,11 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -16504,6 +19354,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescr LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -16513,6 +19364,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -16523,6 +19375,7 @@ int16_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescripto LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -16531,6 +19384,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } @@ -16538,6 +19392,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -16549,6 +19404,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescr LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -16558,6 +19414,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -16568,6 +19425,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescr LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; @@ -16577,6 +19435,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -16587,6 +19446,7 @@ int64_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescripto LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -16595,6 +19455,7 @@ void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_s LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -16602,6 +19463,7 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKPublicKey per_commitment_point_arg_ref; CHECK(*((uint32_t*)per_commitment_point_arg) == 33); @@ -16620,6 +19482,7 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16627,14 +19490,37 @@ uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescript return ret_ref; } +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint32_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_clone(uint32_t orig) { LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16646,6 +19532,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescr LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -16666,6 +19553,7 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_fr LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); StaticPaymentOutputDescriptor_free(this_obj_conv); } @@ -16673,10 +19561,12 @@ uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescripto LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16688,9 +19578,11 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_se LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -16699,6 +19591,7 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_se LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -16710,6 +19603,7 @@ int8_tArray __attribute__((visibility("default"))) TS_StaticPaymentOutputDescri LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; @@ -16719,6 +19613,7 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_se LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -16729,6 +19624,7 @@ int64_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -16737,6 +19633,7 @@ void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_se LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -16744,6 +19641,7 @@ uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescripto LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); @@ -16756,6 +19654,7 @@ uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescripto uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16763,14 +19662,37 @@ uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescripto return ret_ref; } +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint32_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_clone(uint32_t orig) { LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -16782,6 +19704,7 @@ int8_tArray __attribute__((visibility("default"))) TS_StaticPaymentOutputDescri LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -16807,6 +19730,18 @@ void __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_free(u SpendableOutputDescriptor_free(this_ptr_conv); } +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_clone_ptr(uint32_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; + int64_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_clone(uint32_t orig) { LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); @@ -16819,6 +19754,7 @@ uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_st LDKOutPoint outpoint_conv; outpoint_conv.inner = (void*)(outpoint & (~1)); outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); outpoint_conv = OutPoint_clone(&outpoint_conv); void* output_ptr = (void*)(((uint64_t)output) & ~1); CHECK_ACCESS(output_ptr); @@ -16834,6 +19770,7 @@ uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_de LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); @@ -16845,6 +19782,7 @@ uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_st LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); @@ -16879,6 +19817,19 @@ void __attribute__((visibility("default"))) TS_BaseSign_free(uint32_t this_ptr) BaseSign_free(this_ptr_conv); } +static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(arg); + return (uint64_t)ret_ret; +} +int64_t __attribute__((visibility("default"))) TS_Sign_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSign* arg_conv = (LDKSign*)arg_ptr; + int64_t ret_val = Sign_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Sign_clone(uint32_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -16910,6 +19861,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_free(uint32_t thi LDKInMemorySigner this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InMemorySigner_free(this_obj_conv); } @@ -16917,6 +19869,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_fundin LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_funding_key(&this_ptr_conv), 32); return ret_arr; @@ -16926,6 +19879,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_funding_key(u LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -16936,6 +19890,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_revoca LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32); return ret_arr; @@ -16945,6 +19900,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_revocation_ba LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -16955,6 +19911,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_paymen LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_payment_key(&this_ptr_conv), 32); return ret_arr; @@ -16964,6 +19921,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_payment_key(u LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -16974,6 +19932,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_delaye LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32); return ret_arr; @@ -16983,6 +19942,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_delayed_payme LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -16993,6 +19953,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_htlc_b LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32); return ret_arr; @@ -17002,6 +19963,7 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_htlc_base_key LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32); @@ -17012,6 +19974,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_commit LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32); return ret_arr; @@ -17021,20 +19984,44 @@ void __attribute__((visibility("default"))) TS_InMemorySigner_set_commitment_se LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InMemorySigner_clone_ptr(uint32_t arg) { + LDKInMemorySigner arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InMemorySigner_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_clone(uint32_t orig) { LDKInMemorySigner orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17068,6 +20055,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_new(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17079,10 +20067,12 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_counterparty_ LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17094,6 +20084,7 @@ int16_t __attribute__((visibility("default"))) TS_InMemorySigner_counterparty_s LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -17102,6 +20093,7 @@ int16_t __attribute__((visibility("default"))) TS_InMemorySigner_holder_selecte LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -17110,6 +20102,7 @@ jboolean __attribute__((visibility("default"))) TS_InMemorySigner_is_outbound(u LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InMemorySigner_is_outbound(&this_arg_conv); return ret_val; } @@ -17118,10 +20111,12 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_funding_outpo LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17133,10 +20128,12 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_get_channel_p LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17148,6 +20145,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_counterp LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = *((uint32_t*)spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -17156,6 +20154,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_counterp LDKStaticPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -17165,6 +20164,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_dynamic_ LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = *((uint32_t*)spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -17173,6 +20173,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_dynamic_ LDKDelayedPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -17182,6 +20183,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_as_BaseSign(u LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); return (uint64_t)ret_ret; @@ -17191,6 +20193,7 @@ uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_as_Sign(uint3 LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); return (uint64_t)ret_ret; @@ -17200,6 +20203,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_write(uint LDKInMemorySigner obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -17220,6 +20224,7 @@ void __attribute__((visibility("default"))) TS_KeysManager_free(uint32_t this_o LDKKeysManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); KeysManager_free(this_obj_conv); } @@ -17232,6 +20237,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17243,6 +20249,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_derive_channel_k LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char params_arr[32]; CHECK(*((uint32_t*)params) == 32); memcpy(params_arr, (uint8_t*)(params + 4), 32); @@ -17251,6 +20258,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_derive_channel_k uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17262,6 +20270,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_spend_spendable_ LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_SpendableOutputDescriptorZ descriptors_constr; descriptors_constr.datalen = *((uint32_t*)descriptors); if (descriptors_constr.datalen > 0) @@ -17305,6 +20314,7 @@ uint32_t __attribute__((visibility("default"))) TS_KeysManager_as_KeysInterface LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); return (uint64_t)ret_ret; @@ -17314,6 +20324,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_free(uint32_t thi LDKChannelManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManager_free(this_obj_conv); } @@ -17321,6 +20332,7 @@ void __attribute__((visibility("default"))) TS_ChainParameters_free(uint32_t th LDKChainParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainParameters_free(this_obj_conv); } @@ -17328,6 +20340,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_get_network( LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); uint32_t ret_conv = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv)); return ret_conv; } @@ -17336,6 +20349,7 @@ void __attribute__((visibility("default"))) TS_ChainParameters_set_network(uint LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNetwork val_conv = LDKNetwork_from_js(val); ChainParameters_set_network(&this_ptr_conv, val_conv); } @@ -17344,10 +20358,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_get_best_blo LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17359,9 +20375,11 @@ void __attribute__((visibility("default"))) TS_ChainParameters_set_best_block(u LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = BestBlock_clone(&val_conv); ChainParameters_set_best_block(&this_ptr_conv, val_conv); } @@ -17371,11 +20389,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_new(uint32_t LDKBestBlock best_block_arg_conv; best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17383,14 +20403,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChainParameters_new(uint32_t return ret_ref; } +static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChainParameters_clone_ptr(uint32_t arg) { + LDKChainParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChainParameters_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChainParameters_clone(uint32_t orig) { LDKChainParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17402,6 +20445,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_free( LDKCounterpartyForwardingInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyForwardingInfo_free(this_obj_conv); } @@ -17409,6 +20453,7 @@ int32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_ge LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -17417,6 +20462,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_set_f LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); } @@ -17424,6 +20470,7 @@ int32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_ge LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -17432,6 +20479,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_set_f LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); } @@ -17439,6 +20487,7 @@ int16_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_ge LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -17447,6 +20496,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_set_c LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -17455,6 +20505,7 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_n uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17462,14 +20513,37 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_n return ret_ref; } +static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_clone_ptr(uint32_t arg) { + LDKCounterpartyForwardingInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_clone(uint32_t orig) { LDKCounterpartyForwardingInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17481,6 +20555,7 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_free(uint32_ LDKChannelCounterparty this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelCounterparty_free(this_obj_conv); } @@ -17488,6 +20563,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelCounterparty_get_n LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -17497,6 +20573,7 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_set_node_id( LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -17507,10 +20584,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_get_feat LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17522,9 +20601,11 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_set_features LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); ChannelCounterparty_set_features(&this_ptr_conv, val_conv); } @@ -17533,6 +20614,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelCounterparty_get_unspe LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); return ret_val; } @@ -17541,6 +20623,7 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_set_unspenda LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } @@ -17548,11 +20631,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_get_forw LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17565,9 +20650,11 @@ void __attribute__((visibility("default"))) TS_ChannelCounterparty_set_forwardi LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyForwardingInfo_clone(&val_conv); ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } @@ -17579,15 +20666,18 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_new(int8 LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKCounterpartyForwardingInfo forwarding_info_arg_conv; forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17595,14 +20685,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_new(int8 return ret_ref; } +static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelCounterparty_clone_ptr(uint32_t arg) { + LDKChannelCounterparty arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelCounterparty_clone(uint32_t orig) { LDKChannelCounterparty orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17614,6 +20727,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_free(uint32_t thi LDKChannelDetails this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelDetails_free(this_obj_conv); } @@ -17621,6 +20735,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelDetails_get_channe LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ChannelDetails_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -17630,6 +20745,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_channel_id(ui LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -17640,10 +20756,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_counterpa LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17655,9 +20773,11 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_counterparty( LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelCounterparty_clone(&val_conv); ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } @@ -17666,11 +20786,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_funding_t LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17683,9 +20805,11 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_funding_txo(u LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } @@ -17694,6 +20818,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_short_cha LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -17704,6 +20829,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_short_channel LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -17715,6 +20841,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_channel_va LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -17723,6 +20850,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_channel_value LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -17730,6 +20858,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_unspendab LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -17740,6 +20869,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_unspendable_p LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -17751,6 +20881,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_user_chann LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_user_channel_id(&this_ptr_conv); return ret_val; } @@ -17759,6 +20890,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_user_channel_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_user_channel_id(&this_ptr_conv, val); } @@ -17766,6 +20898,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_outbound_c LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -17774,6 +20907,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_outbound_capa LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } @@ -17781,6 +20915,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_inbound_ca LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -17789,6 +20924,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_inbound_capac LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } @@ -17796,6 +20932,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_confirmat LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -17806,6 +20943,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_confirmations LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -17817,6 +20955,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_get_force_clo LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -17827,6 +20966,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_force_close_s LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); @@ -17838,6 +20978,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelDetails_get_is_outbou LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_outbound(&this_ptr_conv); return ret_val; } @@ -17846,6 +20987,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_is_outbound(u LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_outbound(&this_ptr_conv, val); } @@ -17853,6 +20995,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelDetails_get_is_fundin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_funding_locked(&this_ptr_conv); return ret_val; } @@ -17861,6 +21004,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_is_funding_lo LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_funding_locked(&this_ptr_conv, val); } @@ -17868,6 +21012,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelDetails_get_is_usable LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_usable(&this_ptr_conv); return ret_val; } @@ -17876,6 +21021,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_is_usable(uin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_usable(&this_ptr_conv, val); } @@ -17883,6 +21029,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelDetails_get_is_public LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_public(&this_ptr_conv); return ret_val; } @@ -17891,6 +21038,7 @@ void __attribute__((visibility("default"))) TS_ChannelDetails_set_is_public(uin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_public(&this_ptr_conv, val); } @@ -17901,10 +21049,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArr LDKChannelCounterparty counterparty_arg_conv; counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); LDKOutPoint funding_txo_arg_conv; funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1); CHECK_ACCESS(short_channel_id_arg_ptr); @@ -17925,6 +21075,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17932,14 +21083,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArr return ret_ref; } +static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelDetails_clone_ptr(uint32_t arg) { + LDKChannelDetails arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelDetails_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_clone(uint32_t orig) { LDKChannelDetails orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17956,6 +21130,18 @@ void __attribute__((visibility("default"))) TS_PaymentSendFailure_free(uint32_t PaymentSendFailure_free(this_ptr_conv); } +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PaymentSendFailure_clone_ptr(uint32_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; + int64_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_clone(uint32_t orig) { LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); @@ -18037,6 +21223,7 @@ uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_f LDKRouteParameters failed_paths_retry_conv; failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(*((uint32_t*)payment_id) == 32); @@ -18066,15 +21253,18 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_new(uint32_t LDKUserConfig config_conv; config_conv.inner = (void*)(config & (~1)); config_conv.is_owned = (config & 1) || (config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); config_conv = UserConfig_clone(&config_conv); LDKChainParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18086,10 +21276,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_get_current_d LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18101,12 +21293,14 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_channe LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_network_key_ref; CHECK(*((uint32_t*)their_network_key) == 33); memcpy(their_network_key_ref.compressed_form, (uint8_t*)(their_network_key + 4), 33); LDKUserConfig override_config_conv; override_config_conv.inner = (void*)(override_config & (~1)); override_config_conv.is_owned = (override_config & 1) || (override_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); override_config_conv = UserConfig_clone(&override_config_conv); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); @@ -18117,6 +21311,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelManager_list_cha LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -18126,6 +21321,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelManager_list_cha uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -18141,6 +21337,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelManager_list_usa LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -18150,6 +21347,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_ChannelManager_list_usa uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -18165,6 +21363,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_close_channel LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(*((uint32_t*)channel_id) == 32); memcpy(channel_id_arr, (uint8_t*)(channel_id + 4), 32); @@ -18178,6 +21377,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_close_channel LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(*((uint32_t*)channel_id) == 32); memcpy(channel_id_arr, (uint8_t*)(channel_id + 4), 32); @@ -18191,6 +21391,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_force_close_c LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(*((uint32_t*)channel_id) == 32); memcpy(channel_id_arr, (uint8_t*)(channel_id + 4), 32); @@ -18204,6 +21405,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_force_close_all_c LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_force_close_all_channels(&this_arg_conv); } @@ -18211,9 +21413,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_send_payment( LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32); @@ -18229,9 +21433,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_retry_payment LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(*((uint32_t*)payment_id) == 32); memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32); @@ -18244,9 +21450,11 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_send_spontane LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(*((uint32_t*)payment_preimage) == 32); memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32); @@ -18259,6 +21467,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_funding_trans LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char temporary_channel_id_arr[32]; CHECK(*((uint32_t*)temporary_channel_id) == 32); memcpy(temporary_channel_id_arr, (uint8_t*)(temporary_channel_id + 4), 32); @@ -18277,6 +21486,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_broadcast_node_an LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThreeBytes rgb_ref; CHECK(*((uint32_t*)rgb) == 3); memcpy(rgb_ref.data, (uint8_t*)(rgb + 4), 3); @@ -18304,6 +21514,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_process_pending_h LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } @@ -18311,6 +21522,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_timer_tick_occurr LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_timer_tick_occurred(&this_arg_conv); } @@ -18318,6 +21530,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelManager_fail_htlc_bac LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_arr, (uint8_t*)(payment_hash + 4), 32); @@ -18330,6 +21543,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelManager_claim_funds(u LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(*((uint32_t*)payment_preimage) == 32); memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32); @@ -18341,6 +21555,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelManager_get_our_no LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); return ret_arr; @@ -18350,6 +21565,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inboun LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); @@ -18363,6 +21579,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inboun LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32); @@ -18379,6 +21596,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_MessageSen LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -18388,6 +21606,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_EventsProv LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -18397,6 +21616,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Listen(uin LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChannelManager_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -18406,6 +21626,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Confirm(ui LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -18415,6 +21636,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelManager_await_persist LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); return ret_val; } @@ -18423,6 +21645,7 @@ void __attribute__((visibility("default"))) TS_ChannelManager_await_persistable LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_await_persistable_update(&this_arg_conv); } @@ -18430,10 +21653,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_current_best_ LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18445,6 +21670,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_ChannelMes LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -18454,6 +21680,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelManager_write(uint LDKChannelManager obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -18465,6 +21692,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_free(uint LDKChannelManagerReadArgs this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManagerReadArgs_free(this_obj_conv); } @@ -18472,6 +21700,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_k LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; return ret_ret; @@ -18481,6 +21710,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_keys_ LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); @@ -18491,6 +21721,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_f LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; return ret_ret; @@ -18500,6 +21731,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_fee_e LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); @@ -18510,6 +21742,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_c LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; return ret_ret; @@ -18519,6 +21752,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_chain LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKWatch val_conv = *(LDKWatch*)(val_ptr); @@ -18529,6 +21763,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_t LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; return ret_ret; @@ -18538,6 +21773,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_tx_br LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); @@ -18548,6 +21784,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_l LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; return ret_ret; @@ -18557,6 +21794,7 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_logge LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKLogger val_conv = *(LDKLogger*)(val_ptr); @@ -18567,10 +21805,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_get_d LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18582,9 +21822,11 @@ void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_set_defau LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UserConfig_clone(&val_conv); ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } @@ -18608,6 +21850,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_new(u LDKUserConfig default_config_conv; default_config_conv.inner = (void*)(default_config & (~1)); default_config_conv.is_owned = (default_config & 1) || (default_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); default_config_conv = UserConfig_clone(&default_config_conv); LDKCVec_ChannelMonitorZ channel_monitors_constr; channel_monitors_constr.datalen = *((uint32_t*)channel_monitors); @@ -18621,12 +21864,14 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_new(u LDKChannelMonitor channel_monitors_conv_16_conv; channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18641,6 +21886,7 @@ uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMana LDKChannelManagerReadArgs arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = (arg & 1) || (arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); // Warning: we need a move here but no clone is available for LDKChannelManagerReadArgs LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); @@ -18651,17 +21897,41 @@ void __attribute__((visibility("default"))) TS_DecodeError_free(uint32_t this_o LDKDecodeError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DecodeError_free(this_obj_conv); } +static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { + LDKDecodeError ret_var = DecodeError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_DecodeError_clone_ptr(uint32_t arg) { + LDKDecodeError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DecodeError_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_DecodeError_clone(uint32_t orig) { LDKDecodeError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDecodeError ret_var = DecodeError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18673,6 +21943,7 @@ void __attribute__((visibility("default"))) TS_Init_free(uint32_t this_obj) { LDKInit this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Init_free(this_obj_conv); } @@ -18680,10 +21951,12 @@ uint32_t __attribute__((visibility("default"))) TS_Init_get_features(uint32_t t LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18695,9 +21968,11 @@ void __attribute__((visibility("default"))) TS_Init_set_features(uint32_t this_ LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); Init_set_features(&this_ptr_conv, val_conv); } @@ -18706,11 +21981,13 @@ uint32_t __attribute__((visibility("default"))) TS_Init_new(uint32_t features_a LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKInit ret_var = Init_new(features_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18718,14 +21995,37 @@ uint32_t __attribute__((visibility("default"))) TS_Init_new(uint32_t features_a return ret_ref; } +static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { + LDKInit ret_var = Init_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Init_clone_ptr(uint32_t arg) { + LDKInit arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Init_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Init_clone(uint32_t orig) { LDKInit orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInit ret_var = Init_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18737,6 +22037,7 @@ void __attribute__((visibility("default"))) TS_ErrorMessage_free(uint32_t this_ LDKErrorMessage this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErrorMessage_free(this_obj_conv); } @@ -18744,6 +22045,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ErrorMessage_get_channel_ LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ErrorMessage_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -18753,6 +22055,7 @@ void __attribute__((visibility("default"))) TS_ErrorMessage_set_channel_id(uint LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -18763,6 +22066,7 @@ jstring __attribute__((visibility("default"))) TS_ErrorMessage_get_data(uint32_ LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -18773,6 +22077,7 @@ void __attribute__((visibility("default"))) TS_ErrorMessage_set_data(uint32_t t LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = str_ref_to_owned_c(val); ErrorMessage_set_data(&this_ptr_conv, val_conv); } @@ -18786,6 +22091,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorMessage_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18793,14 +22099,37 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorMessage_new(int8_tArray return ret_ref; } +static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ErrorMessage_clone_ptr(uint32_t arg) { + LDKErrorMessage arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ErrorMessage_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ErrorMessage_clone(uint32_t orig) { LDKErrorMessage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18812,6 +22141,7 @@ void __attribute__((visibility("default"))) TS_Ping_free(uint32_t this_obj) { LDKPing this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Ping_free(this_obj_conv); } @@ -18819,6 +22149,7 @@ int16_t __attribute__((visibility("default"))) TS_Ping_get_ponglen(uint32_t thi LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_ponglen(&this_ptr_conv); return ret_val; } @@ -18827,6 +22158,7 @@ void __attribute__((visibility("default"))) TS_Ping_set_ponglen(uint32_t this_p LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_ponglen(&this_ptr_conv, val); } @@ -18834,6 +22166,7 @@ int16_t __attribute__((visibility("default"))) TS_Ping_get_byteslen(uint32_t th LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_byteslen(&this_ptr_conv); return ret_val; } @@ -18842,6 +22175,7 @@ void __attribute__((visibility("default"))) TS_Ping_set_byteslen(uint32_t this_ LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_byteslen(&this_ptr_conv, val); } @@ -18850,6 +22184,7 @@ uint32_t __attribute__((visibility("default"))) TS_Ping_new(int16_t ponglen_arg uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18857,14 +22192,37 @@ uint32_t __attribute__((visibility("default"))) TS_Ping_new(int16_t ponglen_arg return ret_ref; } +static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Ping_clone_ptr(uint32_t arg) { + LDKPing arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Ping_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Ping_clone(uint32_t orig) { LDKPing orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPing ret_var = Ping_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18876,6 +22234,7 @@ void __attribute__((visibility("default"))) TS_Pong_free(uint32_t this_obj) { LDKPong this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Pong_free(this_obj_conv); } @@ -18883,6 +22242,7 @@ int16_t __attribute__((visibility("default"))) TS_Pong_get_byteslen(uint32_t th LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Pong_get_byteslen(&this_ptr_conv); return ret_val; } @@ -18891,6 +22251,7 @@ void __attribute__((visibility("default"))) TS_Pong_set_byteslen(uint32_t this_ LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Pong_set_byteslen(&this_ptr_conv, val); } @@ -18899,6 +22260,7 @@ uint32_t __attribute__((visibility("default"))) TS_Pong_new(int16_t byteslen_ar uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18906,14 +22268,37 @@ uint32_t __attribute__((visibility("default"))) TS_Pong_new(int16_t byteslen_ar return ret_ref; } +static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Pong_clone_ptr(uint32_t arg) { + LDKPong arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Pong_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Pong_clone(uint32_t orig) { LDKPong orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPong ret_var = Pong_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18925,6 +22310,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_free(uint32_t this_o LDKOpenChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OpenChannel_free(this_obj_conv); } @@ -18932,6 +22318,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_chain_has LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *OpenChannel_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -18941,6 +22328,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_chain_hash(uint3 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -18951,6 +22339,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_temporary LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -18960,6 +22349,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_temporary_channe LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -18970,6 +22360,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_funding_satos LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -18978,6 +22369,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_funding_satoshis LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_funding_satoshis(&this_ptr_conv, val); } @@ -18985,6 +22377,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_push_msat(uin LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_push_msat(&this_ptr_conv); return ret_val; } @@ -18993,6 +22386,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_push_msat(uint32 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_push_msat(&this_ptr_conv, val); } @@ -19000,6 +22394,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_dust_limit_sa LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -19008,6 +22403,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_dust_limit_satos LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -19015,6 +22411,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_max_htlc_valu LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -19023,6 +22420,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_max_htlc_value_i LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -19030,6 +22428,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_channel_reser LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -19038,6 +22437,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_channel_reserve_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -19045,6 +22445,7 @@ int64_t __attribute__((visibility("default"))) TS_OpenChannel_get_htlc_minimum_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -19053,6 +22454,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_htlc_minimum_msa LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -19060,6 +22462,7 @@ int32_t __attribute__((visibility("default"))) TS_OpenChannel_get_feerate_per_k LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = OpenChannel_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -19068,6 +22471,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_feerate_per_kw(u LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } @@ -19075,6 +22479,7 @@ int16_t __attribute__((visibility("default"))) TS_OpenChannel_get_to_self_delay LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -19083,6 +22488,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_to_self_delay(ui LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -19090,6 +22496,7 @@ int16_t __attribute__((visibility("default"))) TS_OpenChannel_get_max_accepted_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -19098,6 +22505,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_max_accepted_htl LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -19105,6 +22513,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_funding_p LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19114,6 +22523,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_funding_pubkey(u LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19124,6 +22534,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_revocatio LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19133,6 +22544,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_revocation_basep LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19143,6 +22555,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_payment_p LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19152,6 +22565,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_payment_point(ui LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19162,6 +22576,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_delayed_p LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19171,6 +22586,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_delayed_payment_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19181,6 +22597,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_htlc_base LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19190,6 +22607,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_htlc_basepoint(u LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19200,6 +22618,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_get_first_per LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19209,6 +22628,7 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_first_per_commit LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19219,6 +22639,7 @@ int8_t __attribute__((visibility("default"))) TS_OpenChannel_get_channel_flags( LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = OpenChannel_get_channel_flags(&this_ptr_conv); return ret_val; } @@ -19227,17 +22648,41 @@ void __attribute__((visibility("default"))) TS_OpenChannel_set_channel_flags(ui LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_flags(&this_ptr_conv, val); } +static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_OpenChannel_clone_ptr(uint32_t arg) { + LDKOpenChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OpenChannel_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_OpenChannel_clone(uint32_t orig) { LDKOpenChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19249,6 +22694,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_free(uint32_t this LDKAcceptChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AcceptChannel_free(this_obj_conv); } @@ -19256,6 +22702,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_tempora LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19265,6 +22712,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_temporary_chan LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19275,6 +22723,7 @@ int64_t __attribute__((visibility("default"))) TS_AcceptChannel_get_dust_limit_ LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -19283,6 +22732,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_dust_limit_sat LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -19290,6 +22740,7 @@ int64_t __attribute__((visibility("default"))) TS_AcceptChannel_get_max_htlc_va LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -19298,6 +22749,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_max_htlc_value LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -19305,6 +22757,7 @@ int64_t __attribute__((visibility("default"))) TS_AcceptChannel_get_channel_res LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -19313,6 +22766,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_channel_reserv LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -19320,6 +22774,7 @@ int64_t __attribute__((visibility("default"))) TS_AcceptChannel_get_htlc_minimu LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -19328,6 +22783,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_htlc_minimum_m LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -19335,6 +22791,7 @@ int32_t __attribute__((visibility("default"))) TS_AcceptChannel_get_minimum_dep LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = AcceptChannel_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -19343,6 +22800,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_minimum_depth( LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } @@ -19350,6 +22808,7 @@ int16_t __attribute__((visibility("default"))) TS_AcceptChannel_get_to_self_del LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -19358,6 +22817,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_to_self_delay( LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -19365,6 +22825,7 @@ int16_t __attribute__((visibility("default"))) TS_AcceptChannel_get_max_accepte LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -19373,6 +22834,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_max_accepted_h LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -19380,6 +22842,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_funding LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19389,6 +22852,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_funding_pubkey LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19399,6 +22863,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_revocat LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19408,6 +22873,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_revocation_bas LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19418,6 +22884,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_payment LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19427,6 +22894,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_payment_point( LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19437,6 +22905,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_delayed LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19446,6 +22915,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_delayed_paymen LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19456,6 +22926,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_htlc_ba LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19465,6 +22936,7 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_htlc_basepoint LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19475,6 +22947,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_get_first_p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19484,20 +22957,44 @@ void __attribute__((visibility("default"))) TS_AcceptChannel_set_first_per_comm LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } +static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { + LDKAcceptChannel ret_var = AcceptChannel_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_AcceptChannel_clone_ptr(uint32_t arg) { + LDKAcceptChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AcceptChannel_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_AcceptChannel_clone(uint32_t orig) { LDKAcceptChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19509,6 +23006,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_free(uint32_t thi LDKFundingCreated this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingCreated_free(this_obj_conv); } @@ -19516,6 +23014,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_get_tempor LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19525,6 +23024,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_set_temporary_cha LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19535,6 +23035,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_get_fundin LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *FundingCreated_get_funding_txid(&this_ptr_conv), 32); return ret_arr; @@ -19544,6 +23045,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_set_funding_txid( LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19554,6 +23056,7 @@ int16_t __attribute__((visibility("default"))) TS_FundingCreated_get_funding_ou LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); return ret_val; } @@ -19562,6 +23065,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_set_funding_outpu LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); FundingCreated_set_funding_output_index(&this_ptr_conv, val); } @@ -19569,6 +23073,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_get_signat LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), FundingCreated_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -19578,6 +23083,7 @@ void __attribute__((visibility("default"))) TS_FundingCreated_set_signature(uin LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -19598,6 +23104,7 @@ uint32_t __attribute__((visibility("default"))) TS_FundingCreated_new(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19605,14 +23112,37 @@ uint32_t __attribute__((visibility("default"))) TS_FundingCreated_new(int8_tArr return ret_ref; } +static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { + LDKFundingCreated ret_var = FundingCreated_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_FundingCreated_clone_ptr(uint32_t arg) { + LDKFundingCreated arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingCreated_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_FundingCreated_clone(uint32_t orig) { LDKFundingCreated orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19624,6 +23154,7 @@ void __attribute__((visibility("default"))) TS_FundingSigned_free(uint32_t this LDKFundingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingSigned_free(this_obj_conv); } @@ -19631,6 +23162,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingSigned_get_channel LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *FundingSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19640,6 +23172,7 @@ void __attribute__((visibility("default"))) TS_FundingSigned_set_channel_id(uin LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19650,6 +23183,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingSigned_get_signatu LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), FundingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -19659,6 +23193,7 @@ void __attribute__((visibility("default"))) TS_FundingSigned_set_signature(uint LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -19676,6 +23211,7 @@ uint32_t __attribute__((visibility("default"))) TS_FundingSigned_new(int8_tArra uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19683,14 +23219,37 @@ uint32_t __attribute__((visibility("default"))) TS_FundingSigned_new(int8_tArra return ret_ref; } +static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { + LDKFundingSigned ret_var = FundingSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_FundingSigned_clone_ptr(uint32_t arg) { + LDKFundingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingSigned_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_FundingSigned_clone(uint32_t orig) { LDKFundingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19702,6 +23261,7 @@ void __attribute__((visibility("default"))) TS_FundingLocked_free(uint32_t this LDKFundingLocked this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingLocked_free(this_obj_conv); } @@ -19709,6 +23269,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingLocked_get_channel LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *FundingLocked_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19718,6 +23279,7 @@ void __attribute__((visibility("default"))) TS_FundingLocked_set_channel_id(uin LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19728,6 +23290,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingLocked_get_next_pe LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -19737,6 +23300,7 @@ void __attribute__((visibility("default"))) TS_FundingLocked_set_next_per_commi LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -19754,6 +23318,7 @@ uint32_t __attribute__((visibility("default"))) TS_FundingLocked_new(int8_tArra uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19761,14 +23326,37 @@ uint32_t __attribute__((visibility("default"))) TS_FundingLocked_new(int8_tArra return ret_ref; } +static inline uint64_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { + LDKFundingLocked ret_var = FundingLocked_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_FundingLocked_clone_ptr(uint32_t arg) { + LDKFundingLocked arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingLocked_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_FundingLocked_clone(uint32_t orig) { LDKFundingLocked orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19780,6 +23368,7 @@ void __attribute__((visibility("default"))) TS_Shutdown_free(uint32_t this_obj) LDKShutdown this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Shutdown_free(this_obj_conv); } @@ -19787,6 +23376,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Shutdown_get_channel_id(u LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *Shutdown_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19796,6 +23386,7 @@ void __attribute__((visibility("default"))) TS_Shutdown_set_channel_id(uint32_t LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19806,6 +23397,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Shutdown_get_scriptpubkey LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -19816,6 +23408,7 @@ void __attribute__((visibility("default"))) TS_Shutdown_set_scriptpubkey(uint32 LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = *((uint32_t*)val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -19835,6 +23428,7 @@ uint32_t __attribute__((visibility("default"))) TS_Shutdown_new(int8_tArray cha uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19842,14 +23436,37 @@ uint32_t __attribute__((visibility("default"))) TS_Shutdown_new(int8_tArray cha return ret_ref; } +static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { + LDKShutdown ret_var = Shutdown_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Shutdown_clone_ptr(uint32_t arg) { + LDKShutdown arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Shutdown_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Shutdown_clone(uint32_t orig) { LDKShutdown orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdown ret_var = Shutdown_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19861,6 +23478,7 @@ void __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_free(uint3 LDKClosingSignedFeeRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSignedFeeRange_free(this_obj_conv); } @@ -19868,6 +23486,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_get_min LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -19876,6 +23495,7 @@ void __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_set_min_fe LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); } @@ -19883,6 +23503,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_get_max LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -19891,6 +23512,7 @@ void __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_set_max_fe LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); } @@ -19899,6 +23521,7 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_new(in uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19906,14 +23529,37 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_new(in return ret_ref; } +static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_clone_ptr(uint32_t arg) { + LDKClosingSignedFeeRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_clone(uint32_t orig) { LDKClosingSignedFeeRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19925,6 +23571,7 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_free(uint32_t this LDKClosingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSigned_free(this_obj_conv); } @@ -19932,6 +23579,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingSigned_get_channel LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ClosingSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -19941,6 +23589,7 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_set_channel_id(uin LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -19951,6 +23600,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingSigned_get_fee_satoshi LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSigned_get_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -19959,6 +23609,7 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_set_fee_satoshis(u LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); } @@ -19966,6 +23617,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingSigned_get_signatu LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -19975,6 +23627,7 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_set_signature(uint LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -19985,11 +23638,13 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_get_fee_range( LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20002,9 +23657,11 @@ void __attribute__((visibility("default"))) TS_ClosingSigned_set_fee_range(uint LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ClosingSignedFeeRange_clone(&val_conv); ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } @@ -20019,11 +23676,13 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_new(int8_tArra LDKClosingSignedFeeRange fee_range_arg_conv; fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20031,14 +23690,37 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_new(int8_tArra return ret_ref; } +static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { + LDKClosingSigned ret_var = ClosingSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ClosingSigned_clone_ptr(uint32_t arg) { + LDKClosingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSigned_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_clone(uint32_t orig) { LDKClosingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20050,6 +23732,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_free(uint32_t this LDKUpdateAddHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateAddHTLC_free(this_obj_conv); } @@ -20057,6 +23740,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_channel LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20066,6 +23750,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_channel_id(uin LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20076,6 +23761,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_htlc_id(uin LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -20084,6 +23770,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_htlc_id(uint32 LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -20091,6 +23778,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_amount_msat LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -20099,6 +23787,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_amount_msat(ui LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); } @@ -20106,6 +23795,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_payment LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32); return ret_arr; @@ -20115,6 +23805,7 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_payment_hash(u LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20125,6 +23816,7 @@ int32_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_get_cltv_expiry LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -20133,17 +23825,41 @@ void __attribute__((visibility("default"))) TS_UpdateAddHTLC_set_cltv_expiry(ui LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); } +static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_clone_ptr(uint32_t arg) { + LDKUpdateAddHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_clone(uint32_t orig) { LDKUpdateAddHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20155,6 +23871,7 @@ void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_free(uint32_t LDKUpdateFulfillHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFulfillHTLC_free(this_obj_conv); } @@ -20162,6 +23879,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_get_cha LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20171,6 +23889,7 @@ void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_set_channel_id LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20181,6 +23900,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_get_htlc_id LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -20189,6 +23909,7 @@ void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_set_htlc_id(ui LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -20196,6 +23917,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_get_pay LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32); return ret_arr; @@ -20205,6 +23927,7 @@ void __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_set_payment_pr LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20222,6 +23945,7 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_new(int8_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20229,14 +23953,37 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_new(int8_t return ret_ref; } +static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_clone_ptr(uint32_t arg) { + LDKUpdateFulfillHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_clone(uint32_t orig) { LDKUpdateFulfillHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20248,6 +23995,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailHTLC_free(uint32_t thi LDKUpdateFailHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailHTLC_free(this_obj_conv); } @@ -20255,6 +24003,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFailHTLC_get_channe LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20264,6 +24013,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailHTLC_set_channel_id(ui LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20274,6 +24024,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateFailHTLC_get_htlc_id(ui LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -20282,17 +24033,41 @@ void __attribute__((visibility("default"))) TS_UpdateFailHTLC_set_htlc_id(uint3 LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); } +static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateFailHTLC_clone_ptr(uint32_t arg) { + LDKUpdateFailHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateFailHTLC_clone(uint32_t orig) { LDKUpdateFailHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20304,6 +24079,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_free(uin LDKUpdateFailMalformedHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailMalformedHTLC_free(this_obj_conv); } @@ -20311,6 +24087,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_g LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20320,6 +24097,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_set_chan LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20330,6 +24108,7 @@ int64_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_get_h LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -20338,6 +24117,7 @@ void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_set_htlc LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -20345,6 +24125,7 @@ int16_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_get_f LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); return ret_val; } @@ -20353,17 +24134,41 @@ void __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_set_fail LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); } +static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint32_t arg) { + LDKUpdateFailMalformedHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_clone(uint32_t orig) { LDKUpdateFailMalformedHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20375,6 +24180,7 @@ void __attribute__((visibility("default"))) TS_CommitmentSigned_free(uint32_t t LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentSigned_free(this_obj_conv); } @@ -20382,6 +24188,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CommitmentSigned_get_chan LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *CommitmentSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20391,6 +24198,7 @@ void __attribute__((visibility("default"))) TS_CommitmentSigned_set_channel_id( LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20401,6 +24209,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CommitmentSigned_get_sign LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -20410,6 +24219,7 @@ void __attribute__((visibility("default"))) TS_CommitmentSigned_set_signature(u LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -20420,6 +24230,7 @@ void __attribute__((visibility("default"))) TS_CommitmentSigned_set_htlc_signat LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -20462,6 +24273,7 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentSigned_new(int8_tA uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20469,14 +24281,37 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentSigned_new(int8_tA return ret_ref; } +static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { + LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CommitmentSigned_clone_ptr(uint32_t arg) { + LDKCommitmentSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CommitmentSigned_clone(uint32_t orig) { LDKCommitmentSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20488,6 +24323,7 @@ void __attribute__((visibility("default"))) TS_RevokeAndACK_free(uint32_t this_ LDKRevokeAndACK this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RevokeAndACK_free(this_obj_conv); } @@ -20495,6 +24331,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_get_channel_ LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *RevokeAndACK_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20504,6 +24341,7 @@ void __attribute__((visibility("default"))) TS_RevokeAndACK_set_channel_id(uint LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20514,6 +24352,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_get_per_comm LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32); return ret_arr; @@ -20523,6 +24362,7 @@ void __attribute__((visibility("default"))) TS_RevokeAndACK_set_per_commitment_ LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20533,6 +24373,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_get_next_per LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -20542,6 +24383,7 @@ void __attribute__((visibility("default"))) TS_RevokeAndACK_set_next_per_commit LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -20562,6 +24404,7 @@ uint32_t __attribute__((visibility("default"))) TS_RevokeAndACK_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20569,14 +24412,37 @@ uint32_t __attribute__((visibility("default"))) TS_RevokeAndACK_new(int8_tArray return ret_ref; } +static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { + LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RevokeAndACK_clone_ptr(uint32_t arg) { + LDKRevokeAndACK arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RevokeAndACK_clone(uint32_t orig) { LDKRevokeAndACK orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20588,6 +24454,7 @@ void __attribute__((visibility("default"))) TS_UpdateFee_free(uint32_t this_obj LDKUpdateFee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFee_free(this_obj_conv); } @@ -20595,6 +24462,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFee_get_channel_id( LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UpdateFee_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20604,6 +24472,7 @@ void __attribute__((visibility("default"))) TS_UpdateFee_set_channel_id(uint32_ LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20614,6 +24483,7 @@ int32_t __attribute__((visibility("default"))) TS_UpdateFee_get_feerate_per_kw( LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateFee_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -20622,6 +24492,7 @@ void __attribute__((visibility("default"))) TS_UpdateFee_set_feerate_per_kw(uin LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } @@ -20633,6 +24504,7 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFee_new(int8_tArray ch uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20640,14 +24512,37 @@ uint32_t __attribute__((visibility("default"))) TS_UpdateFee_new(int8_tArray ch return ret_ref; } +static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { + LDKUpdateFee ret_var = UpdateFee_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UpdateFee_clone_ptr(uint32_t arg) { + LDKUpdateFee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFee_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UpdateFee_clone(uint32_t orig) { LDKUpdateFee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20659,6 +24554,7 @@ void __attribute__((visibility("default"))) TS_DataLossProtect_free(uint32_t th LDKDataLossProtect this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DataLossProtect_free(this_obj_conv); } @@ -20666,6 +24562,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DataLossProtect_get_your_ LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32); return ret_arr; @@ -20675,6 +24572,7 @@ void __attribute__((visibility("default"))) TS_DataLossProtect_set_your_last_pe LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20685,6 +24583,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DataLossProtect_get_my_cu LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -20694,6 +24593,7 @@ void __attribute__((visibility("default"))) TS_DataLossProtect_set_my_current_p LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -20711,6 +24611,7 @@ uint32_t __attribute__((visibility("default"))) TS_DataLossProtect_new(int8_tAr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20718,14 +24619,37 @@ uint32_t __attribute__((visibility("default"))) TS_DataLossProtect_new(int8_tAr return ret_ref; } +static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { + LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_DataLossProtect_clone_ptr(uint32_t arg) { + LDKDataLossProtect arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DataLossProtect_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_DataLossProtect_clone(uint32_t orig) { LDKDataLossProtect orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20737,6 +24661,7 @@ void __attribute__((visibility("default"))) TS_ChannelReestablish_free(uint32_t LDKChannelReestablish this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelReestablish_free(this_obj_conv); } @@ -20744,6 +24669,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelReestablish_get_ch LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ChannelReestablish_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20753,6 +24679,7 @@ void __attribute__((visibility("default"))) TS_ChannelReestablish_set_channel_i LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20763,6 +24690,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelReestablish_get_next_l LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); return ret_val; } @@ -20771,6 +24699,7 @@ void __attribute__((visibility("default"))) TS_ChannelReestablish_set_next_loca LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); } @@ -20778,6 +24707,7 @@ int64_t __attribute__((visibility("default"))) TS_ChannelReestablish_get_next_r LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); return ret_val; } @@ -20786,17 +24716,41 @@ void __attribute__((visibility("default"))) TS_ChannelReestablish_set_next_remo LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); } +static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { + LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelReestablish_clone_ptr(uint32_t arg) { + LDKChannelReestablish arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelReestablish_clone(uint32_t orig) { LDKChannelReestablish orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20808,6 +24762,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_free(uint LDKAnnouncementSignatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AnnouncementSignatures_free(this_obj_conv); } @@ -20815,6 +24770,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_ge LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32); return ret_arr; @@ -20824,6 +24780,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_chann LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -20834,6 +24791,7 @@ int64_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_get_sh LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -20842,6 +24800,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_short LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); } @@ -20849,6 +24808,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_ge LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -20858,6 +24818,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_node_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -20868,6 +24829,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_ge LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -20877,6 +24839,7 @@ void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_bitco LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -20897,6 +24860,7 @@ uint32_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_new(i uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20904,14 +24868,37 @@ uint32_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_new(i return ret_ref; } +static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_clone_ptr(uint32_t arg) { + LDKAnnouncementSignatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_clone(uint32_t orig) { LDKAnnouncementSignatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20928,6 +24915,18 @@ void __attribute__((visibility("default"))) TS_NetAddress_free(uint32_t this_pt NetAddress_free(this_ptr_conv); } +static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NetAddress_clone_ptr(uint32_t arg) { + LDKNetAddress* arg_conv = (LDKNetAddress*)arg; + int64_t ret_val = NetAddress_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NetAddress_clone(uint32_t orig) { LDKNetAddress* orig_conv = (LDKNetAddress*)orig; LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); @@ -20998,6 +24997,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_free(ui LDKUnsignedNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedNodeAnnouncement_free(this_obj_conv); } @@ -21005,10 +25005,12 @@ uint32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_get LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21020,9 +25022,11 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_fea LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -21031,6 +25035,7 @@ int32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_get_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); return ret_val; } @@ -21039,6 +25044,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_tim LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); } @@ -21046,6 +25052,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21055,6 +25062,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_nod LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -21065,6 +25073,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(3, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3); return ret_arr; @@ -21074,6 +25083,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_rgb LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK(*((uint32_t*)val) == 3); memcpy(val_ref.data, (uint8_t*)(val + 4), 3); @@ -21084,6 +25094,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32); return ret_arr; @@ -21093,6 +25104,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_ali LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21103,6 +25115,7 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_add LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -21121,14 +25134,37 @@ void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_add UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint32_t arg) { + LDKUnsignedNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_clone(uint32_t orig) { LDKUnsignedNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21140,6 +25176,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncement_free(uint32_t t LDKNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncement_free(this_obj_conv); } @@ -21147,6 +25184,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncement_get_sign LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21156,6 +25194,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncement_set_signature(u LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21166,10 +25205,12 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_get_content LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21181,9 +25222,11 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncement_set_contents(ui LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedNodeAnnouncement_clone(&val_conv); NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -21195,11 +25238,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_new(int8_tA LDKUnsignedNodeAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21207,14 +25252,37 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_new(int8_tA return ret_ref; } +static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeAnnouncement_clone_ptr(uint32_t arg) { + LDKNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_clone(uint32_t orig) { LDKNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21226,6 +25294,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_free LDKUnsignedChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelAnnouncement_free(this_obj_conv); } @@ -21233,10 +25302,12 @@ uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21248,9 +25319,11 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -21259,6 +25332,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -21268,6 +25342,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21278,6 +25353,7 @@ int64_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_g LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -21286,6 +25362,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); } @@ -21293,6 +25370,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21302,6 +25380,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -21312,6 +25391,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21321,6 +25401,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -21331,6 +25412,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21340,6 +25422,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -21350,6 +25433,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -21359,20 +25443,44 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_ LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } +static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint32_t arg) { + LDKUnsignedChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_clone(uint32_t orig) { LDKUnsignedChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21384,6 +25492,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_free(uint32_ LDKChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelAnnouncement_free(this_obj_conv); } @@ -21391,6 +25500,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_n LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21400,6 +25510,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_node_sig LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21410,6 +25521,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_n LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21419,6 +25531,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_node_sig LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21429,6 +25542,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_b LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21438,6 +25552,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_bitcoin_ LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21448,6 +25563,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_b LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21457,6 +25573,7 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_bitcoin_ LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21467,10 +25584,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_get_cont LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21482,9 +25601,11 @@ void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_contents LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelAnnouncement_clone(&val_conv); ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -21505,11 +25626,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_new(int8 LDKUnsignedChannelAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21517,14 +25640,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_new(int8 return ret_ref; } +static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_clone_ptr(uint32_t arg) { + LDKChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_clone(uint32_t orig) { LDKChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21536,6 +25682,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_free(uint3 LDKUnsignedChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelUpdate_free(this_obj_conv); } @@ -21543,6 +25690,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -21552,6 +25700,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_chain_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21562,6 +25711,7 @@ int64_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_sho LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -21570,6 +25720,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_short_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); } @@ -21577,6 +25728,7 @@ int32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_tim LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); return ret_val; } @@ -21585,6 +25737,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_timest LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } @@ -21592,6 +25745,7 @@ int8_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_flag LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = UnsignedChannelUpdate_get_flags(&this_ptr_conv); return ret_val; } @@ -21600,6 +25754,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_flags( LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } @@ -21607,6 +25762,7 @@ int16_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_clt LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -21615,6 +25771,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_cltv_e LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -21622,6 +25779,7 @@ int64_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_htl LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -21630,6 +25788,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_htlc_m LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -21637,6 +25796,7 @@ int32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_fee LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -21645,6 +25805,7 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_fee_ba LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); } @@ -21652,6 +25813,7 @@ int32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_get_fee LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -21660,17 +25822,41 @@ void __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_set_fee_pr LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); } +static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_clone_ptr(uint32_t arg) { + LDKUnsignedChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_clone(uint32_t orig) { LDKUnsignedChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21682,6 +25868,7 @@ void __attribute__((visibility("default"))) TS_ChannelUpdate_free(uint32_t this LDKChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelUpdate_free(this_obj_conv); } @@ -21689,6 +25876,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelUpdate_get_signatu LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -21698,6 +25886,7 @@ void __attribute__((visibility("default"))) TS_ChannelUpdate_set_signature(uint LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -21708,10 +25897,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_get_contents(u LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21723,9 +25914,11 @@ void __attribute__((visibility("default"))) TS_ChannelUpdate_set_contents(uint3 LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelUpdate_clone(&val_conv); ChannelUpdate_set_contents(&this_ptr_conv, val_conv); } @@ -21737,11 +25930,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_new(int8_tArra LDKUnsignedChannelUpdate contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21749,14 +25944,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_new(int8_tArra return ret_ref; } +static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { + LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelUpdate_clone_ptr(uint32_t arg) { + LDKChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_clone(uint32_t orig) { LDKChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21768,6 +25986,7 @@ void __attribute__((visibility("default"))) TS_QueryChannelRange_free(uint32_t LDKQueryChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryChannelRange_free(this_obj_conv); } @@ -21775,6 +25994,7 @@ int8_tArray __attribute__((visibility("default"))) TS_QueryChannelRange_get_cha LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -21784,6 +26004,7 @@ void __attribute__((visibility("default"))) TS_QueryChannelRange_set_chain_hash LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21794,6 +26015,7 @@ int32_t __attribute__((visibility("default"))) TS_QueryChannelRange_get_first_b LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -21802,6 +26024,7 @@ void __attribute__((visibility("default"))) TS_QueryChannelRange_set_first_bloc LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -21809,6 +26032,7 @@ int32_t __attribute__((visibility("default"))) TS_QueryChannelRange_get_number_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -21817,6 +26041,7 @@ void __attribute__((visibility("default"))) TS_QueryChannelRange_set_number_of_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -21828,6 +26053,7 @@ uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_new(int8_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21835,14 +26061,37 @@ uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_new(int8_t return ret_ref; } +static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { + LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_QueryChannelRange_clone_ptr(uint32_t arg) { + LDKQueryChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_clone(uint32_t orig) { LDKQueryChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21854,6 +26103,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_free(uint32_t LDKReplyChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyChannelRange_free(this_obj_conv); } @@ -21861,6 +26111,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ReplyChannelRange_get_cha LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -21870,6 +26121,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_chain_hash LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -21880,6 +26132,7 @@ int32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_get_first_b LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -21888,6 +26141,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_first_bloc LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -21895,6 +26149,7 @@ int32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_get_number_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -21903,6 +26158,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_number_of_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -21910,6 +26166,7 @@ jboolean __attribute__((visibility("default"))) TS_ReplyChannelRange_get_sync_c LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyChannelRange_get_sync_complete(&this_ptr_conv); return ret_val; } @@ -21918,6 +26175,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_sync_compl LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); } @@ -21925,6 +26183,7 @@ void __attribute__((visibility("default"))) TS_ReplyChannelRange_set_short_chan LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -21958,6 +26217,7 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_new(int8_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21965,14 +26225,37 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_new(int8_t return ret_ref; } +static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ReplyChannelRange_clone_ptr(uint32_t arg) { + LDKReplyChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_clone(uint32_t orig) { LDKReplyChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21984,6 +26267,7 @@ void __attribute__((visibility("default"))) TS_QueryShortChannelIds_free(uint32 LDKQueryShortChannelIds this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryShortChannelIds_free(this_obj_conv); } @@ -21991,6 +26275,7 @@ int8_tArray __attribute__((visibility("default"))) TS_QueryShortChannelIds_get_ LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -22000,6 +26285,7 @@ void __attribute__((visibility("default"))) TS_QueryShortChannelIds_set_chain_h LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -22010,6 +26296,7 @@ void __attribute__((visibility("default"))) TS_QueryShortChannelIds_set_short_c LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22043,6 +26330,7 @@ uint32_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_new(int uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22050,14 +26338,37 @@ uint32_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_new(int return ret_ref; } +static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_clone_ptr(uint32_t arg) { + LDKQueryShortChannelIds arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_QueryShortChannelIds_clone(uint32_t orig) { LDKQueryShortChannelIds orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22069,6 +26380,7 @@ void __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_free(uin LDKReplyShortChannelIdsEnd this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyShortChannelIdsEnd_free(this_obj_conv); } @@ -22076,6 +26388,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_g LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -22085,6 +26398,7 @@ void __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_set_chai LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -22095,6 +26409,7 @@ jboolean __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_get_ LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); return ret_val; } @@ -22103,6 +26418,7 @@ void __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_set_full LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); } @@ -22114,6 +26430,7 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_new( uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22121,14 +26438,37 @@ uint32_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_new( return ret_ref; } +static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint32_t arg) { + LDKReplyShortChannelIdsEnd arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_clone(uint32_t orig) { LDKReplyShortChannelIdsEnd orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22140,6 +26480,7 @@ void __attribute__((visibility("default"))) TS_GossipTimestampFilter_free(uint3 LDKGossipTimestampFilter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); GossipTimestampFilter_free(this_obj_conv); } @@ -22147,6 +26488,7 @@ int8_tArray __attribute__((visibility("default"))) TS_GossipTimestampFilter_get LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32); return ret_arr; @@ -22156,6 +26498,7 @@ void __attribute__((visibility("default"))) TS_GossipTimestampFilter_set_chain_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -22166,6 +26509,7 @@ int32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_get_fir LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); return ret_val; } @@ -22174,6 +26518,7 @@ void __attribute__((visibility("default"))) TS_GossipTimestampFilter_set_first_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); } @@ -22181,6 +26526,7 @@ int32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_get_tim LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); return ret_val; } @@ -22189,6 +26535,7 @@ void __attribute__((visibility("default"))) TS_GossipTimestampFilter_set_timest LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); } @@ -22200,6 +26547,7 @@ uint32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_new(in uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22207,14 +26555,37 @@ uint32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_new(in return ret_ref; } +static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_clone_ptr(uint32_t arg) { + LDKGossipTimestampFilter arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_clone(uint32_t orig) { LDKGossipTimestampFilter orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22231,6 +26602,18 @@ void __attribute__((visibility("default"))) TS_ErrorAction_free(uint32_t this_p ErrorAction_free(this_ptr_conv); } +static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ErrorAction_clone_ptr(uint32_t arg) { + LDKErrorAction* arg_conv = (LDKErrorAction*)arg; + int64_t ret_val = ErrorAction_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ErrorAction_clone(uint32_t orig) { LDKErrorAction* orig_conv = (LDKErrorAction*)orig; LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); @@ -22243,6 +26626,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorAction_disconnect_peer( LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_disconnect_peer(msg_conv); @@ -22269,6 +26653,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErrorAction_send_error_messa LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_send_error_message(msg_conv); @@ -22280,6 +26665,7 @@ void __attribute__((visibility("default"))) TS_LightningError_free(uint32_t thi LDKLightningError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LightningError_free(this_obj_conv); } @@ -22287,6 +26673,7 @@ jstring __attribute__((visibility("default"))) TS_LightningError_get_err(uint32 LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = LightningError_get_err(&this_ptr_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -22297,6 +26684,7 @@ void __attribute__((visibility("default"))) TS_LightningError_set_err(uint32_t LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = str_ref_to_owned_c(val); LightningError_set_err(&this_ptr_conv, val_conv); } @@ -22305,6 +26693,7 @@ uint32_t __attribute__((visibility("default"))) TS_LightningError_get_action(ui LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = LightningError_get_action(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -22315,6 +26704,7 @@ void __attribute__((visibility("default"))) TS_LightningError_set_action(uint32 LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); @@ -22332,6 +26722,7 @@ uint32_t __attribute__((visibility("default"))) TS_LightningError_new(jstring e uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22339,14 +26730,37 @@ uint32_t __attribute__((visibility("default"))) TS_LightningError_new(jstring e return ret_ref; } +static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { + LDKLightningError ret_var = LightningError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_LightningError_clone_ptr(uint32_t arg) { + LDKLightningError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = LightningError_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_LightningError_clone(uint32_t orig) { LDKLightningError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKLightningError ret_var = LightningError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22358,6 +26772,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_free(uint32_t t LDKCommitmentUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentUpdate_free(this_obj_conv); } @@ -22365,6 +26780,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -22374,6 +26790,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up uint64_t ret_conv_15_ref = 0; CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner; if (ret_conv_15_var.is_owned) { ret_conv_15_ref |= 1; @@ -22389,6 +26806,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_add_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22401,6 +26819,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_add_ LDKUpdateAddHTLC val_conv_15_conv; val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); val_constr.data[p] = val_conv_15_conv; } @@ -22411,6 +26830,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -22420,6 +26840,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up uint64_t ret_conv_19_ref = 0; CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner; if (ret_conv_19_var.is_owned) { ret_conv_19_ref |= 1; @@ -22435,6 +26856,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fulf LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22447,6 +26869,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fulf LDKUpdateFulfillHTLC val_conv_19_conv; val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); val_constr.data[t] = val_conv_19_conv; } @@ -22457,6 +26880,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -22466,6 +26890,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -22481,6 +26906,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fail LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22493,6 +26919,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fail LDKUpdateFailHTLC val_conv_16_conv; val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); val_constr.data[q] = val_conv_16_conv; } @@ -22503,6 +26930,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -22512,6 +26940,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_CommitmentUpdate_get_up uint64_t ret_conv_25_ref = 0; CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner; if (ret_conv_25_var.is_owned) { ret_conv_25_ref |= 1; @@ -22527,6 +26956,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fail LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -22539,6 +26969,7 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fail LDKUpdateFailMalformedHTLC val_conv_25_conv; val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); val_constr.data[z] = val_conv_25_conv; } @@ -22549,11 +26980,13 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_get_update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22566,9 +26999,11 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_update_fee( LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UpdateFee_clone(&val_conv); CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); } @@ -22577,10 +27012,12 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_get_commitm LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22592,9 +27029,11 @@ void __attribute__((visibility("default"))) TS_CommitmentUpdate_set_commitment_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CommitmentSigned_clone(&val_conv); CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); } @@ -22612,6 +27051,7 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; } @@ -22627,6 +27067,7 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; } @@ -22642,6 +27083,7 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; } @@ -22657,21 +27099,25 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; } LDKUpdateFee update_fee_arg_conv; update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); LDKCommitmentSigned commitment_signed_arg_conv; commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22679,14 +27125,37 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_new(uint32_ return ret_ref; } +static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CommitmentUpdate_clone_ptr(uint32_t arg) { + LDKCommitmentUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CommitmentUpdate_clone(uint32_t orig) { LDKCommitmentUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22716,6 +27185,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AcceptChannel_write(uint3 LDKAcceptChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22736,6 +27206,7 @@ int8_tArray __attribute__((visibility("default"))) TS_AnnouncementSignatures_wr LDKAnnouncementSignatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22756,6 +27227,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelReestablish_write( LDKChannelReestablish obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22776,6 +27248,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingSigned_write(uint3 LDKClosingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22796,6 +27269,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_wri LDKClosingSignedFeeRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22816,6 +27290,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CommitmentSigned_write(ui LDKCommitmentSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22836,6 +27311,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingCreated_write(uint LDKFundingCreated obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22856,6 +27332,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingSigned_write(uint3 LDKFundingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22876,6 +27353,7 @@ int8_tArray __attribute__((visibility("default"))) TS_FundingLocked_write(uint3 LDKFundingLocked obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22896,6 +27374,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Init_write(uint32_t obj) LDKInit obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Init_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22916,6 +27395,7 @@ int8_tArray __attribute__((visibility("default"))) TS_OpenChannel_write(uint32_ LDKOpenChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22936,6 +27416,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RevokeAndACK_write(uint32 LDKRevokeAndACK obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22956,6 +27437,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Shutdown_write(uint32_t o LDKShutdown obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22976,6 +27458,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFailHTLC_write(uint LDKUpdateFailHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -22996,6 +27479,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_w LDKUpdateFailMalformedHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23016,6 +27500,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFee_write(uint32_t LDKUpdateFee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23036,6 +27521,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_write(u LDKUpdateFulfillHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23056,6 +27542,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UpdateAddHTLC_write(uint3 LDKUpdateAddHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23076,6 +27563,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Ping_write(uint32_t obj) LDKPing obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Ping_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23096,6 +27584,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Pong_write(uint32_t obj) LDKPong obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Pong_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23116,6 +27605,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelAnnounceme LDKUnsignedChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23136,6 +27626,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelAnnouncement_write LDKChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23156,6 +27647,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_wri LDKUnsignedChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23176,6 +27668,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelUpdate_write(uint3 LDKChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23196,6 +27689,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ErrorMessage_write(uint32 LDKErrorMessage obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23216,6 +27710,7 @@ int8_tArray __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_ LDKUnsignedNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23236,6 +27731,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncement_write(ui LDKNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23265,6 +27761,7 @@ int8_tArray __attribute__((visibility("default"))) TS_QueryShortChannelIds_writ LDKQueryShortChannelIds obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23276,6 +27773,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_w LDKReplyShortChannelIdsEnd obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23296,6 +27794,7 @@ int32_t __attribute__((visibility("default"))) TS_QueryChannelRange_end_blocknu LDKQueryChannelRange this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv); return ret_val; } @@ -23304,6 +27803,7 @@ int8_tArray __attribute__((visibility("default"))) TS_QueryChannelRange_write(u LDKQueryChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23333,6 +27833,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ReplyChannelRange_write(u LDKReplyChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23344,6 +27845,7 @@ int8_tArray __attribute__((visibility("default"))) TS_GossipTimestampFilter_wri LDKGossipTimestampFilter obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23373,6 +27875,7 @@ void __attribute__((visibility("default"))) TS_IgnoringMessageHandler_free(uint LDKIgnoringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); IgnoringMessageHandler_free(this_obj_conv); } @@ -23381,6 +27884,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_new() uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23392,6 +27896,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Me LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -23401,6 +27906,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Ro LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -23410,6 +27916,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Cu LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); return (uint64_t)ret_ret; @@ -23419,6 +27926,7 @@ uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_as_Cu LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -23428,6 +27936,7 @@ void __attribute__((visibility("default"))) TS_ErroringMessageHandler_free(uint LDKErroringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErroringMessageHandler_free(this_obj_conv); } @@ -23436,6 +27945,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_new() uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23447,6 +27957,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_as_Me LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -23456,6 +27967,7 @@ uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_as_Ch LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -23465,6 +27977,7 @@ void __attribute__((visibility("default"))) TS_MessageHandler_free(uint32_t thi LDKMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MessageHandler_free(this_obj_conv); } @@ -23472,6 +27985,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_get_chan_hand LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -23481,6 +27995,7 @@ void __attribute__((visibility("default"))) TS_MessageHandler_set_chan_handler( LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); @@ -23491,6 +28006,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_get_route_han LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -23500,6 +28016,7 @@ void __attribute__((visibility("default"))) TS_MessageHandler_set_route_handler LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); @@ -23517,6 +28034,7 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_new(uint32_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23524,6 +28042,19 @@ uint32_t __attribute__((visibility("default"))) TS_MessageHandler_new(uint32_t return ret_ref; } +static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(arg); + return (uint64_t)ret_ret; +} +int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; + int64_t ret_val = SocketDescriptor_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_SocketDescriptor_clone(uint32_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -23546,6 +28077,7 @@ void __attribute__((visibility("default"))) TS_PeerHandleError_free(uint32_t th LDKPeerHandleError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerHandleError_free(this_obj_conv); } @@ -23553,6 +28085,7 @@ jboolean __attribute__((visibility("default"))) TS_PeerHandleError_get_no_conne LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv); return ret_val; } @@ -23561,6 +28094,7 @@ void __attribute__((visibility("default"))) TS_PeerHandleError_set_no_connectio LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); } @@ -23569,6 +28103,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_new(jboolean uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23576,14 +28111,37 @@ uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_new(jboolean return ret_ref; } +static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { + LDKPeerHandleError ret_var = PeerHandleError_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PeerHandleError_clone_ptr(uint32_t arg) { + LDKPeerHandleError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PeerHandleError_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_clone(uint32_t orig) { LDKPeerHandleError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23595,6 +28153,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_free(uint32_t this_o LDKPeerManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerManager_free(this_obj_conv); } @@ -23602,6 +28161,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_new(uint32_t mes LDKMessageHandler message_handler_conv; message_handler_conv.inner = (void*)(message_handler & (~1)); message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); // Warning: we need a move here but no clone is available for LDKMessageHandler LDKSecretKey our_node_secret_ref; CHECK(*((uint32_t*)our_node_secret) == 32); @@ -23620,6 +28180,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_new(uint32_t mes uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23631,6 +28192,7 @@ ptrArray __attribute__((visibility("default"))) TS_PeerManager_get_peer_node_id LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); ptrArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes"); @@ -23649,6 +28211,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_new_outbound_con LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_node_id_ref; CHECK(*((uint32_t*)their_node_id) == 33); memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33); @@ -23664,6 +28227,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_new_inbound_conn LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); @@ -23676,6 +28240,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_write_buffer_spa LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -23688,6 +28253,7 @@ uint32_t __attribute__((visibility("default"))) TS_PeerManager_read_event(uint3 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1); if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; @@ -23703,6 +28269,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_process_events(uint3 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_process_events(&this_arg_conv); } @@ -23710,6 +28277,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_socket_disconnected( LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -23720,6 +28288,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_disconnect_by_node_i LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey node_id_ref; CHECK(*((uint32_t*)node_id) == 33); memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33); @@ -23730,6 +28299,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_disconnect_all_peers LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_disconnect_all_peers(&this_arg_conv); } @@ -23737,6 +28307,7 @@ void __attribute__((visibility("default"))) TS_PeerManager_timer_tick_occurred( LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_timer_tick_occurred(&this_arg_conv); } @@ -23762,6 +28333,7 @@ int8_tArray __attribute__((visibility("default"))) TS_build_closing_transaction LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -23825,6 +28397,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_free(uint32_t thi LDKTxCreationKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TxCreationKeys_free(this_obj_conv); } @@ -23832,6 +28405,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_per_co LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23841,6 +28415,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_per_commitmen LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23851,6 +28426,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_revoca LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23860,6 +28436,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_revocation_ke LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23870,6 +28447,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_broadc LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23879,6 +28457,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_broadcaster_h LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23889,6 +28468,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_counte LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23898,6 +28478,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_countersignat LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23908,6 +28489,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_get_broadc LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -23917,6 +28499,7 @@ void __attribute__((visibility("default"))) TS_TxCreationKeys_set_broadcaster_d LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -23943,6 +28526,7 @@ uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_new(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23950,14 +28534,37 @@ uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_new(int8_tArr return ret_ref; } +static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { + LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_TxCreationKeys_clone_ptr(uint32_t arg) { + LDKTxCreationKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_clone(uint32_t orig) { LDKTxCreationKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23969,6 +28576,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TxCreationKeys_write(uint LDKTxCreationKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -23989,6 +28597,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_free(uint32_t LDKChannelPublicKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelPublicKeys_free(this_obj_conv); } @@ -23996,6 +28605,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_fun LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24005,6 +28615,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_funding_pu LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24015,6 +28626,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_rev LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24024,6 +28636,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_revocation LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24034,6 +28647,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_pay LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24043,6 +28657,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_payment_po LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24053,6 +28668,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_del LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24062,6 +28678,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_delayed_pa LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24072,6 +28689,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_get_htl LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -24081,6 +28699,7 @@ void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_htlc_basep LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -24107,6 +28726,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_new(int8_t uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24114,14 +28734,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_new(int8_t return ret_ref; } +static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_clone_ptr(uint32_t arg) { + LDKChannelPublicKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_clone(uint32_t orig) { LDKChannelPublicKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24133,6 +28776,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelPublicKeys_write(u LDKChannelPublicKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24177,9 +28821,11 @@ uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_from_channel_ LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -24203,6 +28849,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_free(uint LDKHTLCOutputInCommitment this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCOutputInCommitment_free(this_obj_conv); } @@ -24210,6 +28857,7 @@ jboolean __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_o LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv); return ret_val; } @@ -24218,6 +28866,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_offer LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); } @@ -24225,6 +28874,7 @@ int64_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_am LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -24233,6 +28883,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_amoun LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); } @@ -24240,6 +28891,7 @@ int32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_cl LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -24248,6 +28900,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_cltv_ LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); } @@ -24255,6 +28908,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_ge LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32); return ret_arr; @@ -24264,6 +28918,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_payme LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -24274,6 +28929,7 @@ uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_get_t LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -24284,6 +28940,7 @@ void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_set_trans LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -24303,6 +28960,7 @@ uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_new(j uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24310,14 +28968,37 @@ uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_new(j return ret_ref; } +static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_clone_ptr(uint32_t arg) { + LDKHTLCOutputInCommitment arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_clone(uint32_t orig) { LDKHTLCOutputInCommitment orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24329,6 +29010,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_wr LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24349,9 +29031,11 @@ int8_tArray __attribute__((visibility("default"))) TS_get_htlc_redeemscript(uin LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKTxCreationKeys keys_conv; keys_conv.inner = (void*)(keys & (~1)); keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24381,6 +29065,7 @@ int8_tArray __attribute__((visibility("default"))) TS_build_htlc_transaction(in LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK(*((uint32_t*)broadcaster_delayed_payment_key) == 33); memcpy(broadcaster_delayed_payment_key_ref.compressed_form, (uint8_t*)(broadcaster_delayed_payment_key + 4), 33); @@ -24398,6 +29083,7 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_fre LDKChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelTransactionParameters_free(this_obj_conv); } @@ -24405,10 +29091,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24420,9 +29108,11 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } @@ -24431,6 +29121,7 @@ int16_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_ LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -24439,6 +29130,7 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } @@ -24446,6 +29138,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); return ret_val; } @@ -24454,6 +29147,7 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); } @@ -24461,11 +29155,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24478,9 +29174,11 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); } @@ -24489,11 +29187,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24506,9 +29206,11 @@ void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } @@ -24517,19 +29219,23 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); LDKOutPoint funding_outpoint_arg_conv; funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24537,14 +29243,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters return ret_ref; } +static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_clone_ptr(uint32_t arg) { + LDKChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_clone(uint32_t orig) { LDKChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24556,6 +29285,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionPa LDKCounterpartyChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyChannelTransactionParameters_free(this_obj_conv); } @@ -24563,10 +29293,12 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransacti LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24578,9 +29310,11 @@ void __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionPa LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } @@ -24589,6 +29323,7 @@ int16_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransactio LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -24597,6 +29332,7 @@ void __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionPa LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } @@ -24604,11 +29340,13 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransacti LDKChannelPublicKeys pubkeys_arg_conv; pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24616,14 +29354,37 @@ uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransacti return ret_ref; } +static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint32_t arg) { + LDKCounterpartyChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionParameters_clone(uint32_t orig) { LDKCounterpartyChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24635,6 +29396,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelTransactionParameters_is_populated(&this_arg_conv); return ret_val; } @@ -24643,10 +29405,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24658,10 +29422,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24673,6 +29439,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CounterpartyChannelTransa LDKCounterpartyChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24693,6 +29460,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelTransactionParamet LDKChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24713,6 +29481,7 @@ void __attribute__((visibility("default"))) TS_DirectedChannelTransactionParame LDKDirectedChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectedChannelTransactionParameters_free(this_obj_conv); } @@ -24720,10 +29489,12 @@ uint32_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24735,10 +29506,12 @@ uint32_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24750,6 +29523,7 @@ int16_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPar LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); return ret_val; } @@ -24758,6 +29532,7 @@ jboolean __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); return ret_val; } @@ -24766,10 +29541,12 @@ uint32_t __attribute__((visibility("default"))) TS_DirectedChannelTransactionPa LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24781,6 +29558,7 @@ void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_free LDKHolderCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HolderCommitmentTransaction_free(this_obj_conv); } @@ -24788,6 +29566,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HolderCommitmentTransacti LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64); return ret_arr; @@ -24797,6 +29576,7 @@ void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_set_ LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(*((uint32_t*)val) == 64); memcpy(val_ref.compact_form, (uint8_t*)(val + 4), 64); @@ -24807,6 +29587,7 @@ void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_set_ LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -24824,14 +29605,37 @@ void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_set_ HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } +static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_clone_ptr(uint32_t arg) { + LDKHolderCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_clone(uint32_t orig) { LDKHolderCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24843,6 +29647,7 @@ int8_tArray __attribute__((visibility("default"))) TS_HolderCommitmentTransacti LDKHolderCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24863,6 +29668,7 @@ uint32_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_ LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); LDKSignature counterparty_sig_ref; CHECK(*((uint32_t*)counterparty_sig) == 64); @@ -24891,6 +29697,7 @@ uint32_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24902,6 +29709,7 @@ void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_free( LDKBuiltCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BuiltCommitmentTransaction_free(this_obj_conv); } @@ -24909,6 +29717,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -24920,6 +29729,7 @@ void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_set_t LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction val_ref; val_ref.datalen = *((uint32_t*)val); val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); @@ -24932,6 +29742,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32); return ret_arr; @@ -24941,6 +29752,7 @@ void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_set_t LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -24960,6 +29772,7 @@ uint32_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_n uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24967,14 +29780,37 @@ uint32_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_n return ret_ref; } +static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_clone_ptr(uint32_t arg) { + LDKBuiltCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_clone(uint32_t orig) { LDKBuiltCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24986,6 +29822,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25006,6 +29843,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = *((uint32_t*)funding_redeemscript); funding_redeemscript_ref.data = (int8_t*)(funding_redeemscript + 4); @@ -25018,6 +29856,7 @@ int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransactio LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK(*((uint32_t*)funding_key) == 32); memcpy(funding_key_arr, (uint8_t*)(funding_key + 4), 32); @@ -25034,17 +29873,41 @@ void __attribute__((visibility("default"))) TS_ClosingTransaction_free(uint32_t LDKClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingTransaction_free(this_obj_conv); } +static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { + LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_clone_ptr(uint32_t arg) { + LDKClosingTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_clone(uint32_t orig) { LDKClosingTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25056,6 +29919,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_hash(uint3 LDKClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ClosingTransaction_hash(&o_conv); return ret_val; } @@ -25072,11 +29936,13 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_new(int64 LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25088,10 +29954,12 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_trust(uin LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25103,9 +29971,11 @@ uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_verify(ui LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); @@ -25116,6 +29986,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_to_holder_ LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_holder_value_sat(&this_arg_conv); return ret_val; } @@ -25124,6 +29995,7 @@ int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_to_counter LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); return ret_val; } @@ -25132,6 +30004,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingTransaction_to_hol LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25142,6 +30015,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ClosingTransaction_to_cou LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25152,6 +30026,7 @@ void __attribute__((visibility("default"))) TS_TrustedClosingTransaction_free(u LDKTrustedClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedClosingTransaction_free(this_obj_conv); } @@ -25159,6 +30034,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TrustedClosingTransaction LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25170,6 +30046,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TrustedClosingTransaction LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = *((uint32_t*)funding_redeemscript); funding_redeemscript_ref.data = (int8_t*)(funding_redeemscript + 4); @@ -25182,6 +30059,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TrustedClosingTransaction LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK(*((uint32_t*)funding_key) == 32); memcpy(funding_key_arr, (uint8_t*)(funding_key + 4), 32); @@ -25198,17 +30076,41 @@ void __attribute__((visibility("default"))) TS_CommitmentTransaction_free(uint3 LDKCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentTransaction_free(this_obj_conv); } +static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_CommitmentTransaction_clone_ptr(uint32_t arg) { + LDKCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_clone(uint32_t orig) { LDKCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25220,6 +30122,7 @@ int8_tArray __attribute__((visibility("default"))) TS_CommitmentTransaction_wri LDKCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25240,6 +30143,7 @@ int64_t __attribute__((visibility("default"))) TS_CommitmentTransaction_commitm LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_commitment_number(&this_arg_conv); return ret_val; } @@ -25248,6 +30152,7 @@ int64_t __attribute__((visibility("default"))) TS_CommitmentTransaction_to_broa LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); return ret_val; } @@ -25256,6 +30161,7 @@ int64_t __attribute__((visibility("default"))) TS_CommitmentTransaction_to_coun LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); return ret_val; } @@ -25264,6 +30170,7 @@ int32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_feerate LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = CommitmentTransaction_feerate_per_kw(&this_arg_conv); return ret_val; } @@ -25272,10 +30179,12 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_trust( LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25287,15 +30196,19 @@ uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_verify LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -25305,6 +30218,7 @@ void __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_fre LDKTrustedCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedCommitmentTransaction_free(this_obj_conv); } @@ -25312,6 +30226,7 @@ int8_tArray __attribute__((visibility("default"))) TS_TrustedCommitmentTransact LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32); return ret_arr; @@ -25321,10 +30236,12 @@ uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25336,10 +30253,12 @@ uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25351,6 +30270,7 @@ uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char htlc_base_key_arr[32]; CHECK(*((uint32_t*)htlc_base_key) == 32); memcpy(htlc_base_key_arr, (uint8_t*)(htlc_base_key + 4), 32); @@ -25358,6 +30278,7 @@ uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); return (uint64_t)ret_conv; @@ -25378,9 +30299,11 @@ jboolean __attribute__((visibility("default"))) TS_InitFeatures_eq(uint32_t a, LDKInitFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInitFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InitFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -25389,9 +30312,11 @@ jboolean __attribute__((visibility("default"))) TS_NodeFeatures_eq(uint32_t a, LDKNodeFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKNodeFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = NodeFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -25400,9 +30325,11 @@ jboolean __attribute__((visibility("default"))) TS_ChannelFeatures_eq(uint32_t LDKChannelFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKChannelFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ChannelFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -25411,21 +30338,46 @@ jboolean __attribute__((visibility("default"))) TS_InvoiceFeatures_eq(uint32_t LDKInvoiceFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceFeatures_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InitFeatures_clone_ptr(uint32_t arg) { + LDKInitFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InitFeatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InitFeatures_clone(uint32_t orig) { LDKInitFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25433,14 +30385,37 @@ uint32_t __attribute__((visibility("default"))) TS_InitFeatures_clone(uint32_t return ret_ref; } +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeFeatures_clone_ptr(uint32_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeFeatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_clone(uint32_t orig) { LDKNodeFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25448,14 +30423,37 @@ uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_clone(uint32_t return ret_ref; } +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelFeatures_clone_ptr(uint32_t arg) { + LDKChannelFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_clone(uint32_t orig) { LDKChannelFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25463,14 +30461,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_clone(uint32 return ret_ref; } +static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InvoiceFeatures_clone_ptr(uint32_t arg) { + LDKInvoiceFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_clone(uint32_t orig) { LDKInvoiceFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25482,6 +30503,7 @@ void __attribute__((visibility("default"))) TS_InitFeatures_free(uint32_t this_ LDKInitFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InitFeatures_free(this_obj_conv); } @@ -25489,6 +30511,7 @@ void __attribute__((visibility("default"))) TS_NodeFeatures_free(uint32_t this_ LDKNodeFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeFeatures_free(this_obj_conv); } @@ -25496,6 +30519,7 @@ void __attribute__((visibility("default"))) TS_ChannelFeatures_free(uint32_t th LDKChannelFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelFeatures_free(this_obj_conv); } @@ -25503,6 +30527,7 @@ void __attribute__((visibility("default"))) TS_InvoiceFeatures_free(uint32_t th LDKInvoiceFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceFeatures_free(this_obj_conv); } @@ -25511,6 +30536,7 @@ uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25523,6 +30549,7 @@ uint32_t __attribute__((visibility("default"))) TS_InitFeatures_known() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25534,6 +30561,7 @@ jboolean __attribute__((visibility("default"))) TS_InitFeatures_requires_unknow LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -25543,6 +30571,7 @@ uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_empty() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25555,6 +30584,7 @@ uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_known() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25566,6 +30596,7 @@ jboolean __attribute__((visibility("default"))) TS_NodeFeatures_requires_unknow LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -25575,6 +30606,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_empty() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25587,6 +30619,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_known() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25598,6 +30631,7 @@ jboolean __attribute__((visibility("default"))) TS_ChannelFeatures_requires_unk LDKChannelFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -25607,6 +30641,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_empty() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25619,6 +30654,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_known() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25630,6 +30666,7 @@ jboolean __attribute__((visibility("default"))) TS_InvoiceFeatures_requires_unk LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -25638,6 +30675,7 @@ jboolean __attribute__((visibility("default"))) TS_InitFeatures_supports_paymen LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -25646,6 +30684,7 @@ jboolean __attribute__((visibility("default"))) TS_NodeFeatures_supports_paymen LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -25654,6 +30693,7 @@ jboolean __attribute__((visibility("default"))) TS_InvoiceFeatures_supports_pay LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -25662,6 +30702,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InitFeatures_write(uint32 LDKInitFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25673,6 +30714,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeFeatures_write(uint32 LDKNodeFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25684,6 +30726,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelFeatures_write(uin LDKChannelFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25695,6 +30738,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InvoiceFeatures_write(uin LDKInvoiceFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25742,17 +30786,41 @@ void __attribute__((visibility("default"))) TS_ShutdownScript_free(uint32_t thi LDKShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ShutdownScript_free(this_obj_conv); } +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ShutdownScript_clone_ptr(uint32_t arg) { + LDKShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ShutdownScript_clone(uint32_t orig) { LDKShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25764,6 +30832,7 @@ void __attribute__((visibility("default"))) TS_InvalidShutdownScript_free(uint3 LDKInvalidShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvalidShutdownScript_free(this_obj_conv); } @@ -25771,6 +30840,7 @@ int8_tArray __attribute__((visibility("default"))) TS_InvalidShutdownScript_get LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25781,6 +30851,7 @@ void __attribute__((visibility("default"))) TS_InvalidShutdownScript_set_script LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = *((uint32_t*)val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -25797,6 +30868,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_new(in uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25804,14 +30876,37 @@ uint32_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_new(in return ret_ref; } +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_clone_ptr(uint32_t arg) { + LDKInvalidShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_clone(uint32_t orig) { LDKInvalidShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25823,6 +30918,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ShutdownScript_write(uint LDKShutdownScript obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25848,6 +30944,7 @@ uint32_t __attribute__((visibility("default"))) TS_ShutdownScript_new_p2wpkh(in uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25864,6 +30961,7 @@ uint32_t __attribute__((visibility("default"))) TS_ShutdownScript_new_p2wsh(int uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25884,6 +30982,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ShutdownScript_into_inner LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = ShutdownScript_clone(&this_arg_conv); LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); @@ -25896,6 +30995,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ShutdownScript_as_legacy_ LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); return ret_arr; @@ -25905,9 +31005,11 @@ jboolean __attribute__((visibility("default"))) TS_ShutdownScript_is_compatible LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInitFeatures features_conv; features_conv.inner = (void*)(features & (~1)); features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); jboolean ret_val = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_val; } @@ -25921,6 +31023,19 @@ void __attribute__((visibility("default"))) TS_CustomMessageReader_free(uint32_ CustomMessageReader_free(this_ptr_conv); } +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return (uint64_t)ret_ret; +} +int64_t __attribute__((visibility("default"))) TS_Type_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_val = Type_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Type_clone(uint32_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -25952,6 +31067,7 @@ void __attribute__((visibility("default"))) TS_LockableScore_free(uint32_t this LDKLockableScore this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockableScore_free(this_obj_conv); } @@ -25963,6 +31079,7 @@ uint32_t __attribute__((visibility("default"))) TS_LockableScore_new(uint32_t s uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25974,6 +31091,7 @@ int8_tArray __attribute__((visibility("default"))) TS_LockableScore_write(uint3 LDKLockableScore obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -25985,17 +31103,41 @@ void __attribute__((visibility("default"))) TS_NodeId_free(uint32_t this_obj) { LDKNodeId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeId_free(this_obj_conv); } +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeId_clone_ptr(uint32_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeId_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeId_clone(uint32_t orig) { LDKNodeId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeId ret_var = NodeId_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26011,6 +31153,7 @@ uint32_t __attribute__((visibility("default"))) TS_NodeId_from_pubkey(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26022,6 +31165,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeId_as_slice(uint32_t LDKNodeId this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26032,6 +31176,7 @@ int64_t __attribute__((visibility("default"))) TS_NodeId_hash(uint32_t o) { LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = NodeId_hash(&o_conv); return ret_val; } @@ -26040,6 +31185,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeId_write(uint32_t obj LDKNodeId obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26060,17 +31206,41 @@ void __attribute__((visibility("default"))) TS_NetworkGraph_free(uint32_t this_ LDKNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetworkGraph_free(this_obj_conv); } +static inline uint64_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { + LDKNetworkGraph ret_var = NetworkGraph_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NetworkGraph_clone_ptr(uint32_t arg) { + LDKNetworkGraph arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NetworkGraph_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_clone(uint32_t orig) { LDKNetworkGraph orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26082,6 +31252,7 @@ void __attribute__((visibility("default"))) TS_ReadOnlyNetworkGraph_free(uint32 LDKReadOnlyNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReadOnlyNetworkGraph_free(this_obj_conv); } @@ -26094,6 +31265,18 @@ void __attribute__((visibility("default"))) TS_NetworkUpdate_free(uint32_t this NetworkUpdate_free(this_ptr_conv); } +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NetworkUpdate_clone_ptr(uint32_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)arg; + int64_t ret_val = NetworkUpdate_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NetworkUpdate_clone(uint32_t orig) { LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)orig; LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); @@ -26106,6 +31289,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkUpdate_channel_update LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_update_message(msg_conv); @@ -26139,10 +31323,20 @@ int8_tArray __attribute__((visibility("default"))) TS_NetworkUpdate_write(uint3 return ret_arr; } +uint32_t __attribute__((visibility("default"))) TS_NetworkUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = *((uint32_t*)ser); + ser_ref.data = (int8_t*)(ser + 4); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + return (uint64_t)ret_conv; +} + uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_as_EventHandler(uint32_t this_arg) { LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26152,6 +31346,7 @@ void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_free(uint32_t LDKNetGraphMsgHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetGraphMsgHandler_free(this_obj_conv); } @@ -26159,6 +31354,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_new(uint3 LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -26173,6 +31369,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_new(uint3 uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26184,6 +31381,7 @@ void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_add_chain_acc LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -26198,6 +31396,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_as_Routin LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26207,6 +31406,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_as_Messag LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -26216,6 +31416,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_free(uint LDKDirectionalChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectionalChannelInfo_free(this_obj_conv); } @@ -26223,6 +31424,7 @@ int32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_la LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = DirectionalChannelInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -26231,6 +31433,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_last_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_last_update(&this_ptr_conv, val); } @@ -26238,6 +31441,7 @@ jboolean __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_e LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = DirectionalChannelInfo_get_enabled(&this_ptr_conv); return ret_val; } @@ -26246,6 +31450,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_enabl LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_enabled(&this_ptr_conv, val); } @@ -26253,6 +31458,7 @@ int16_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_cl LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -26261,6 +31467,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_cltv_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -26268,6 +31475,7 @@ int64_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_ht LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DirectionalChannelInfo_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -26276,6 +31484,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_htlc_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -26283,6 +31492,7 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_h LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -26293,6 +31503,7 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_htlc_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -26304,10 +31515,12 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_f LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26319,9 +31532,11 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_fees( LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); DirectionalChannelInfo_set_fees(&this_ptr_conv, val_conv); } @@ -26330,11 +31545,13 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_get_l LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26347,9 +31564,11 @@ void __attribute__((visibility("default"))) TS_DirectionalChannelInfo_set_last_ LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelUpdate_clone(&val_conv); DirectionalChannelInfo_set_last_update_message(&this_ptr_conv, val_conv); } @@ -26362,15 +31581,18 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_new(i LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); LDKChannelUpdate last_update_message_arg_conv; last_update_message_arg_conv.inner = (void*)(last_update_message_arg & (~1)); last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26378,14 +31600,37 @@ uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_new(i return ret_ref; } +static inline uint64_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg) { + LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_clone_ptr(uint32_t arg) { + LDKDirectionalChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_clone(uint32_t orig) { LDKDirectionalChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26397,6 +31642,7 @@ int8_tArray __attribute__((visibility("default"))) TS_DirectionalChannelInfo_wr LDKDirectionalChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26417,6 +31663,7 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_free(uint32_t this_o LDKChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelInfo_free(this_obj_conv); } @@ -26424,10 +31671,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_features(uin LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26439,9 +31688,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_features(uint32_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); ChannelInfo_set_features(&this_ptr_conv, val_conv); } @@ -26450,10 +31701,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_node_one(uin LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26465,9 +31718,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_node_one(uint32_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } @@ -26476,11 +31731,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_one_to_two(u LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26493,9 +31750,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_one_to_two(uint3 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); } @@ -26504,10 +31763,12 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_node_two(uin LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26519,9 +31780,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_node_two(uint32_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } @@ -26530,11 +31793,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_two_to_one(u LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26547,9 +31812,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_two_to_one(uint3 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } @@ -26558,6 +31825,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_capacity_sat LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -26568,6 +31836,7 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_capacity_sats(ui LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -26579,11 +31848,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_get_announcement LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26596,9 +31867,11 @@ void __attribute__((visibility("default"))) TS_ChannelInfo_set_announcement_mes LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelAnnouncement_clone(&val_conv); ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -26607,22 +31880,27 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t fea LDKChannelFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = ChannelFeatures_clone(&features_arg_conv); LDKNodeId node_one_arg_conv; node_one_arg_conv.inner = (void*)(node_one_arg & (~1)); node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv); node_one_arg_conv = NodeId_clone(&node_one_arg_conv); LDKDirectionalChannelInfo one_to_two_arg_conv; one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1)); one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv); one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv); LDKNodeId node_two_arg_conv; node_two_arg_conv.inner = (void*)(node_two_arg & (~1)); node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv); node_two_arg_conv = NodeId_clone(&node_two_arg_conv); LDKDirectionalChannelInfo two_to_one_arg_conv; two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1)); two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv); two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv); void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1); CHECK_ACCESS(capacity_sats_arg_ptr); @@ -26631,11 +31909,13 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t fea LDKChannelAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv); LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26643,14 +31923,37 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t fea return ret_ref; } +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ChannelInfo_clone_ptr(uint32_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_clone(uint32_t orig) { LDKChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26662,6 +31965,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ChannelInfo_write(uint32_ LDKChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26682,6 +31986,7 @@ void __attribute__((visibility("default"))) TS_RoutingFees_free(uint32_t this_o LDKRoutingFees this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RoutingFees_free(this_obj_conv); } @@ -26689,6 +31994,7 @@ int32_t __attribute__((visibility("default"))) TS_RoutingFees_get_base_msat(uin LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_base_msat(&this_ptr_conv); return ret_val; } @@ -26697,6 +32003,7 @@ void __attribute__((visibility("default"))) TS_RoutingFees_set_base_msat(uint32 LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_base_msat(&this_ptr_conv, val); } @@ -26704,6 +32011,7 @@ int32_t __attribute__((visibility("default"))) TS_RoutingFees_get_proportional_ LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -26712,6 +32020,7 @@ void __attribute__((visibility("default"))) TS_RoutingFees_set_proportional_mil LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } @@ -26720,6 +32029,7 @@ uint32_t __attribute__((visibility("default"))) TS_RoutingFees_new(int32_t base uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26731,21 +32041,46 @@ jboolean __attribute__((visibility("default"))) TS_RoutingFees_eq(uint32_t a, u LDKRoutingFees a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoutingFees b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RoutingFees_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RoutingFees_clone_ptr(uint32_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RoutingFees_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RoutingFees_clone(uint32_t orig) { LDKRoutingFees orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26757,6 +32092,7 @@ int64_t __attribute__((visibility("default"))) TS_RoutingFees_hash(uint32_t o) LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RoutingFees_hash(&o_conv); return ret_val; } @@ -26765,6 +32101,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RoutingFees_write(uint32_ LDKRoutingFees obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26785,6 +32122,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_free(uint32 LDKNodeAnnouncementInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncementInfo_free(this_obj_conv); } @@ -26792,10 +32130,12 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_fea LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26807,9 +32147,11 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_feature LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); } @@ -26818,6 +32160,7 @@ int32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_last LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -26826,6 +32169,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_last_up LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); } @@ -26833,6 +32177,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_ LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(3, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3); return ret_arr; @@ -26842,6 +32187,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_rgb(uin LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK(*((uint32_t*)val) == 3); memcpy(val_ref.data, (uint8_t*)(val + 4), 3); @@ -26852,6 +32198,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_ LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *NodeAnnouncementInfo_get_alias(&this_ptr_conv), 32); return ret_arr; @@ -26861,6 +32208,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_alias(u LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(*((uint32_t*)val) == 32); memcpy(val_ref.data, (uint8_t*)(val + 4), 32); @@ -26871,6 +32219,7 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_address LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -26893,11 +32242,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_get_ann LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26910,9 +32261,11 @@ void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_set_announc LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncement_clone(&val_conv); NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -26921,6 +32274,7 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_new(uin LDKNodeFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = NodeFeatures_clone(&features_arg_conv); LDKThreeBytes rgb_arg_ref; CHECK(*((uint32_t*)rgb_arg) == 3); @@ -26945,11 +32299,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_new(uin LDKNodeAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, announcement_message_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26957,14 +32313,37 @@ uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_new(uin return ret_ref; } +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_clone_ptr(uint32_t arg) { + LDKNodeAnnouncementInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_clone(uint32_t orig) { LDKNodeAnnouncementInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26976,6 +32355,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_writ LDKNodeAnnouncementInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -26996,6 +32376,7 @@ void __attribute__((visibility("default"))) TS_NodeInfo_free(uint32_t this_obj) LDKNodeInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeInfo_free(this_obj_conv); } @@ -27003,6 +32384,7 @@ void __attribute__((visibility("default"))) TS_NodeInfo_set_channels(uint32_t t LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -27021,11 +32403,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeInfo_get_lowest_inbound_ LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27038,9 +32422,11 @@ void __attribute__((visibility("default"))) TS_NodeInfo_set_lowest_inbound_chan LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv); } @@ -27049,11 +32435,13 @@ uint32_t __attribute__((visibility("default"))) TS_NodeInfo_get_announcement_in LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27066,9 +32454,11 @@ void __attribute__((visibility("default"))) TS_NodeInfo_set_announcement_info(u LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncementInfo_clone(&val_conv); NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } @@ -27088,15 +32478,18 @@ uint32_t __attribute__((visibility("default"))) TS_NodeInfo_new(int64_tArray ch LDKRoutingFees lowest_inbound_channel_fees_arg_conv; lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1)); lowest_inbound_channel_fees_arg_conv.is_owned = (lowest_inbound_channel_fees_arg & 1) || (lowest_inbound_channel_fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv); lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv); LDKNodeAnnouncementInfo announcement_info_arg_conv; announcement_info_arg_conv.inner = (void*)(announcement_info_arg & (~1)); announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27104,14 +32497,37 @@ uint32_t __attribute__((visibility("default"))) TS_NodeInfo_new(int64_tArray ch return ret_ref; } +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_NodeInfo_clone_ptr(uint32_t arg) { + LDKNodeInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeInfo_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_NodeInfo_clone(uint32_t orig) { LDKNodeInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27123,6 +32539,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NodeInfo_write(uint32_t o LDKNodeInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27143,6 +32560,7 @@ int8_tArray __attribute__((visibility("default"))) TS_NetworkGraph_write(uint32 LDKNetworkGraph obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27167,6 +32585,7 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27178,10 +32597,12 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_read_only(uint3 LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27193,9 +32614,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_node_fro LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -27205,9 +32628,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_node_fro LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -27217,9 +32642,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -27236,9 +32663,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); @@ -27255,6 +32684,7 @@ void __attribute__((visibility("default"))) TS_NetworkGraph_close_channel_from_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent); } @@ -27262,6 +32692,7 @@ void __attribute__((visibility("default"))) TS_NetworkGraph_fail_node(uint32_t LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey _node_id_ref; CHECK(*((uint32_t*)_node_id) == 33); memcpy(_node_id_ref.compressed_form, (uint8_t*)(_node_id + 4), 33); @@ -27272,9 +32703,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel( LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -27284,9 +32717,11 @@ uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -27296,6 +32731,7 @@ uint32_t __attribute__((visibility("default"))) TS_ReadOnlyNetworkGraph_get_add LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey pubkey_ref; CHECK(*((uint32_t*)pubkey) == 33); memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33); @@ -27309,6 +32745,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_free(uint32_t this_obj) LDKRouteHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHop_free(this_obj_conv); } @@ -27316,6 +32753,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHop_get_pubkey(uint3 LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -27325,6 +32763,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_pubkey(uint32_t thi LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -27335,10 +32774,12 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_get_node_features(u LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27350,9 +32791,11 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_node_features(uint3 LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); RouteHop_set_node_features(&this_ptr_conv, val_conv); } @@ -27361,6 +32804,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHop_get_short_channel_id LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -27369,6 +32813,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_short_channel_id(ui LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_short_channel_id(&this_ptr_conv, val); } @@ -27376,10 +32821,12 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_get_channel_feature LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27391,9 +32838,11 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_channel_features(ui LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); RouteHop_set_channel_features(&this_ptr_conv, val_conv); } @@ -27402,6 +32851,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHop_get_fee_msat(uint32_ LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_fee_msat(&this_ptr_conv); return ret_val; } @@ -27410,6 +32860,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_fee_msat(uint32_t t LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_fee_msat(&this_ptr_conv, val); } @@ -27417,6 +32868,7 @@ int32_t __attribute__((visibility("default"))) TS_RouteHop_get_cltv_expiry_delt LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -27425,6 +32877,7 @@ void __attribute__((visibility("default"))) TS_RouteHop_set_cltv_expiry_delta(u LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -27435,15 +32888,18 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_new(int8_tArray pub LDKNodeFeatures node_features_arg_conv; node_features_arg_conv.inner = (void*)(node_features_arg & (~1)); node_features_arg_conv.is_owned = (node_features_arg & 1) || (node_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); LDKChannelFeatures channel_features_arg_conv; channel_features_arg_conv.inner = (void*)(channel_features_arg & (~1)); channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27451,14 +32907,37 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHop_new(int8_tArray pub return ret_ref; } +static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RouteHop_clone_ptr(uint32_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHop_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RouteHop_clone(uint32_t orig) { LDKRouteHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHop ret_var = RouteHop_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27470,6 +32949,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHop_hash(uint32_t o) { LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHop_hash(&o_conv); return ret_val; } @@ -27478,9 +32958,11 @@ jboolean __attribute__((visibility("default"))) TS_RouteHop_eq(uint32_t a, uint LDKRouteHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHop_eq(&a_conv, &b_conv); return ret_val; } @@ -27489,6 +32971,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHop_write(uint32_t o LDKRouteHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27509,6 +32992,7 @@ void __attribute__((visibility("default"))) TS_Route_free(uint32_t this_obj) { LDKRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Route_free(this_obj_conv); } @@ -27516,6 +33000,7 @@ ptrArray __attribute__((visibility("default"))) TS_Route_get_paths(uint32_t thi LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv); ptrArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes"); @@ -27530,6 +33015,7 @@ ptrArray __attribute__((visibility("default"))) TS_Route_get_paths(uint32_t thi uint64_t ret_conv_12_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var); ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner; if (ret_conv_12_conv_10_var.is_owned) { ret_conv_12_conv_10_ref |= 1; @@ -27549,6 +33035,7 @@ void __attribute__((visibility("default"))) TS_Route_set_paths(uint32_t this_pt LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -27570,6 +33057,7 @@ void __attribute__((visibility("default"))) TS_Route_set_paths(uint32_t this_pt LDKRouteHop val_conv_12_conv_10_conv; val_conv_12_conv_10_conv.inner = (void*)(val_conv_12_conv_10 & (~1)); val_conv_12_conv_10_conv.is_owned = (val_conv_12_conv_10 & 1) || (val_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv); val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv); val_conv_12_constr.data[k] = val_conv_12_conv_10_conv; } @@ -27582,11 +33070,13 @@ uint32_t __attribute__((visibility("default"))) TS_Route_get_payee(uint32_t thi LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = Route_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27599,9 +33089,11 @@ void __attribute__((visibility("default"))) TS_Route_set_payee(uint32_t this_pt LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); Route_set_payee(&this_ptr_conv, val_conv); } @@ -27628,6 +33120,7 @@ uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg LDKRouteHop paths_arg_conv_12_conv_10_conv; paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1)); paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv; } @@ -27636,11 +33129,13 @@ uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRoute ret_var = Route_new(paths_arg_constr, payee_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27648,14 +33143,37 @@ uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg return ret_ref; } +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Route_clone_ptr(uint32_t arg) { + LDKRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Route_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Route_clone(uint32_t orig) { LDKRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoute ret_var = Route_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27667,6 +33185,7 @@ int64_t __attribute__((visibility("default"))) TS_Route_hash(uint32_t o) { LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Route_hash(&o_conv); return ret_val; } @@ -27675,9 +33194,11 @@ jboolean __attribute__((visibility("default"))) TS_Route_eq(uint32_t a, uint32_ LDKRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Route_eq(&a_conv, &b_conv); return ret_val; } @@ -27686,6 +33207,7 @@ int64_t __attribute__((visibility("default"))) TS_Route_get_total_fees(uint32_t LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_fees(&this_arg_conv); return ret_val; } @@ -27694,6 +33216,7 @@ int64_t __attribute__((visibility("default"))) TS_Route_get_total_amount(uint32 LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_amount(&this_arg_conv); return ret_val; } @@ -27702,6 +33225,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Route_write(uint32_t obj) LDKRoute obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Route_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27722,6 +33246,7 @@ void __attribute__((visibility("default"))) TS_RouteParameters_free(uint32_t th LDKRouteParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteParameters_free(this_obj_conv); } @@ -27729,10 +33254,12 @@ uint32_t __attribute__((visibility("default"))) TS_RouteParameters_get_payee(ui LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27744,9 +33271,11 @@ void __attribute__((visibility("default"))) TS_RouteParameters_set_payee(uint32 LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); RouteParameters_set_payee(&this_ptr_conv, val_conv); } @@ -27755,6 +33284,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteParameters_get_final_val LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_val; } @@ -27763,6 +33293,7 @@ void __attribute__((visibility("default"))) TS_RouteParameters_set_final_value_ LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_value_msat(&this_ptr_conv, val); } @@ -27770,6 +33301,7 @@ int32_t __attribute__((visibility("default"))) TS_RouteParameters_get_final_clt LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -27778,6 +33310,7 @@ void __attribute__((visibility("default"))) TS_RouteParameters_set_final_cltv_e LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val); } @@ -27785,11 +33318,13 @@ uint32_t __attribute__((visibility("default"))) TS_RouteParameters_new(uint32_t LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27797,14 +33332,37 @@ uint32_t __attribute__((visibility("default"))) TS_RouteParameters_new(uint32_t return ret_ref; } +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RouteParameters_clone_ptr(uint32_t arg) { + LDKRouteParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteParameters_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RouteParameters_clone(uint32_t orig) { LDKRouteParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27816,6 +33374,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteParameters_write(uin LDKRouteParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -27836,6 +33395,7 @@ void __attribute__((visibility("default"))) TS_Payee_free(uint32_t this_obj) { LDKPayee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Payee_free(this_obj_conv); } @@ -27843,6 +33403,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Payee_get_pubkey(uint32_t LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), Payee_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -27852,6 +33413,7 @@ void __attribute__((visibility("default"))) TS_Payee_set_pubkey(uint32_t this_p LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -27862,11 +33424,13 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_get_features(uint32_t LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures ret_var = Payee_get_features(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27879,9 +33443,11 @@ void __attribute__((visibility("default"))) TS_Payee_set_features(uint32_t this LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InvoiceFeatures_clone(&val_conv); Payee_set_features(&this_ptr_conv, val_conv); } @@ -27890,6 +33456,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Payee_get_route_hints(u LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -27899,6 +33466,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Payee_get_route_hints(u uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -27914,6 +33482,7 @@ void __attribute__((visibility("default"))) TS_Payee_set_route_hints(uint32_t t LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -27926,6 +33495,7 @@ void __attribute__((visibility("default"))) TS_Payee_set_route_hints(uint32_t t LDKRouteHint val_conv_11_conv; val_conv_11_conv.inner = (void*)(val_conv_11 & (~1)); val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv); val_conv_11_conv = RouteHint_clone(&val_conv_11_conv); val_constr.data[l] = val_conv_11_conv; } @@ -27936,6 +33506,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_get_expiry_time(uint32 LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Payee_get_expiry_time(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -27946,6 +33517,7 @@ void __attribute__((visibility("default"))) TS_Payee_set_expiry_time(uint32_t t LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -27960,6 +33532,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey LDKInvoiceFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InvoiceFeatures_clone(&features_arg_conv); LDKCVec_RouteHintZ route_hints_arg_constr; route_hints_arg_constr.datalen = *((uint32_t*)route_hints_arg); @@ -27973,6 +33546,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey LDKRouteHint route_hints_arg_conv_11_conv; route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1)); route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv); route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv); route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv; } @@ -27984,6 +33558,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27991,14 +33566,37 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey return ret_ref; } +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee ret_var = Payee_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Payee_clone_ptr(uint32_t arg) { + LDKPayee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Payee_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Payee_clone(uint32_t orig) { LDKPayee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayee ret_var = Payee_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28010,6 +33608,7 @@ int64_t __attribute__((visibility("default"))) TS_Payee_hash(uint32_t o) { LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Payee_hash(&o_conv); return ret_val; } @@ -28018,9 +33617,11 @@ jboolean __attribute__((visibility("default"))) TS_Payee_eq(uint32_t a, uint32_ LDKPayee a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayee b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Payee_eq(&a_conv, &b_conv); return ret_val; } @@ -28029,6 +33630,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Payee_write(uint32_t obj) LDKPayee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Payee_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28053,6 +33655,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_from_node_id(int8_tArr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28068,6 +33671,7 @@ uint32_t __attribute__((visibility("default"))) TS_Payee_for_keysend(int8_tArra uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28079,6 +33683,7 @@ void __attribute__((visibility("default"))) TS_RouteHint_free(uint32_t this_obj LDKRouteHint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHint_free(this_obj_conv); } @@ -28086,6 +33691,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RouteHint_get_a(uint32_ LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -28095,6 +33701,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RouteHint_get_a(uint32_ uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -28110,6 +33717,7 @@ void __attribute__((visibility("default"))) TS_RouteHint_set_a(uint32_t this_pt LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ val_constr; val_constr.datalen = *((uint32_t*)val); if (val_constr.datalen > 0) @@ -28122,6 +33730,7 @@ void __attribute__((visibility("default"))) TS_RouteHint_set_a(uint32_t this_pt LDKRouteHintHop val_conv_14_conv; val_conv_14_conv.inner = (void*)(val_conv_14 & (~1)); val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); val_constr.data[o] = val_conv_14_conv; } @@ -28141,6 +33750,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(uint32_tArray LDKRouteHintHop a_arg_conv_14_conv; a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1)); a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); a_arg_constr.data[o] = a_arg_conv_14_conv; } @@ -28148,6 +33758,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(uint32_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28155,14 +33766,37 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(uint32_tArray return ret_ref; } +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RouteHint_clone_ptr(uint32_t arg) { + LDKRouteHint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHint_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RouteHint_clone(uint32_t orig) { LDKRouteHint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHint ret_var = RouteHint_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28174,6 +33808,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHint_hash(uint32_t o) { LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHint_hash(&o_conv); return ret_val; } @@ -28182,9 +33817,11 @@ jboolean __attribute__((visibility("default"))) TS_RouteHint_eq(uint32_t a, uin LDKRouteHint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHint_eq(&a_conv, &b_conv); return ret_val; } @@ -28193,6 +33830,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHint_write(uint32_t LDKRouteHint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28213,6 +33851,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_free(uint32_t this_ LDKRouteHintHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHintHop_free(this_obj_conv); } @@ -28220,6 +33859,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHintHop_get_src_node LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -28229,6 +33869,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_src_node_id(uin LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -28239,6 +33880,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHintHop_get_short_channe LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHintHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -28247,6 +33889,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_short_channel_i LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_short_channel_id(&this_ptr_conv, val); } @@ -28254,10 +33897,12 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_get_fees(uint32 LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28269,9 +33914,11 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_fees(uint32_t t LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); RouteHintHop_set_fees(&this_ptr_conv, val_conv); } @@ -28280,6 +33927,7 @@ int16_t __attribute__((visibility("default"))) TS_RouteHintHop_get_cltv_expiry_ LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -28288,6 +33936,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_cltv_expiry_del LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -28295,6 +33944,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_get_htlc_minimu LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -28305,6 +33955,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_htlc_minimum_ms LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -28316,6 +33967,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_get_htlc_maximu LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -28326,6 +33978,7 @@ void __attribute__((visibility("default"))) TS_RouteHintHop_set_htlc_maximum_ms LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -28340,6 +33993,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_new(int8_tArray LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1); CHECK_ACCESS(htlc_minimum_msat_arg_ptr); @@ -28353,6 +34007,7 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28360,14 +34015,37 @@ uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_new(int8_tArray return ret_ref; } +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RouteHintHop_clone_ptr(uint32_t arg) { + LDKRouteHintHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHintHop_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RouteHintHop_clone(uint32_t orig) { LDKRouteHintHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28379,6 +34057,7 @@ int64_t __attribute__((visibility("default"))) TS_RouteHintHop_hash(uint32_t o) LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHintHop_hash(&o_conv); return ret_val; } @@ -28387,9 +34066,11 @@ jboolean __attribute__((visibility("default"))) TS_RouteHintHop_eq(uint32_t a, LDKRouteHintHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHintHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHintHop_eq(&a_conv, &b_conv); return ret_val; } @@ -28398,6 +34079,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RouteHintHop_write(uint32 LDKRouteHintHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28421,9 +34103,11 @@ uint32_t __attribute__((visibility("default"))) TS_find_route(int8_tArray our_n LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKNetworkGraph network_conv; network_conv.inner = (void*)(network & (~1)); network_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != 0) { @@ -28438,6 +34122,7 @@ uint32_t __attribute__((visibility("default"))) TS_find_route(int8_tArray our_n LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } first_hops_ptr = &first_hops_constr; @@ -28458,6 +34143,7 @@ void __attribute__((visibility("default"))) TS_Scorer_free(uint32_t this_obj) { LDKScorer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Scorer_free(this_obj_conv); } @@ -28465,6 +34151,7 @@ void __attribute__((visibility("default"))) TS_ScoringParameters_free(uint32_t LDKScoringParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ScoringParameters_free(this_obj_conv); } @@ -28472,6 +34159,7 @@ int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_base_pe LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv); return ret_val; } @@ -28480,6 +34168,7 @@ void __attribute__((visibility("default"))) TS_ScoringParameters_set_base_penal LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val); } @@ -28487,6 +34176,7 @@ int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_failure LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv); return ret_val; } @@ -28495,6 +34185,7 @@ void __attribute__((visibility("default"))) TS_ScoringParameters_set_failure_pe LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val); } @@ -28502,6 +34193,7 @@ int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_failure LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv); return ret_val; } @@ -28510,6 +34202,7 @@ void __attribute__((visibility("default"))) TS_ScoringParameters_set_failure_pe LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val); } @@ -28518,6 +34211,7 @@ uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_new(int64_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28529,6 +34223,7 @@ int8_tArray __attribute__((visibility("default"))) TS_ScoringParameters_write(u LDKScoringParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28549,11 +34244,13 @@ uint32_t __attribute__((visibility("default"))) TS_Scorer_new(uint32_t params) LDKScoringParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKScorer ret_var = Scorer_new(params_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28566,6 +34263,7 @@ uint32_t __attribute__((visibility("default"))) TS_Scorer_default() { uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28578,6 +34276,7 @@ uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_default() uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28589,6 +34288,7 @@ uint32_t __attribute__((visibility("default"))) TS_Scorer_as_Score(uint32_t thi LDKScorer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); *ret_ret = Scorer_as_Score(&this_arg_conv); return (uint64_t)ret_ret; @@ -28598,6 +34298,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Scorer_write(uint32_t obj LDKScorer obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Scorer_write(&obj_conv); int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen); @@ -28618,6 +34319,7 @@ void __attribute__((visibility("default"))) TS_FilesystemPersister_free(uint32_ LDKFilesystemPersister this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FilesystemPersister_free(this_obj_conv); } @@ -28627,6 +34329,7 @@ uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_new(jstr uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28638,6 +34341,7 @@ jstring __attribute__((visibility("default"))) TS_FilesystemPersister_get_data_ LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -28649,6 +34353,7 @@ uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_persist_ LDKChannelManager manager_conv; manager_conv.inner = (void*)(manager & (~1)); manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = FilesystemPersister_persist_manager(data_dir_conv, &manager_conv); return (uint64_t)ret_conv; @@ -28658,6 +34363,7 @@ uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_read_cha LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -28670,6 +34376,7 @@ uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_as_Persi LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); *ret_ret = FilesystemPersister_as_Persist(&this_arg_conv); return (uint64_t)ret_ret; @@ -28679,6 +34386,7 @@ void __attribute__((visibility("default"))) TS_BackgroundProcessor_free(uint32_ LDKBackgroundProcessor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BackgroundProcessor_free(this_obj_conv); } @@ -28701,15 +34409,19 @@ uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_start(ui LDKChainMonitor chain_monitor_conv; chain_monitor_conv.inner = (void*)(chain_monitor & (~1)); chain_monitor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv); LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKNetGraphMsgHandler net_graph_msg_handler_conv; net_graph_msg_handler_conv.inner = (void*)(net_graph_msg_handler & (~1)); net_graph_msg_handler_conv.is_owned = (net_graph_msg_handler & 1) || (net_graph_msg_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(net_graph_msg_handler_conv); LDKPeerManager peer_manager_conv; peer_manager_conv.inner = (void*)(peer_manager & (~1)); peer_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -28717,6 +34429,7 @@ uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_start(ui uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28728,6 +34441,7 @@ uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_join(uin LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_join(this_arg_conv); @@ -28738,6 +34452,7 @@ uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_stop(uin LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_stop(this_arg_conv); @@ -28752,6 +34467,7 @@ void __attribute__((visibility("default"))) TS_Invoice_free(uint32_t this_obj) LDKInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Invoice_free(this_obj_conv); } @@ -28759,21 +34475,46 @@ jboolean __attribute__((visibility("default"))) TS_Invoice_eq(uint32_t a, uint3 LDKInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Invoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) { + LDKInvoice ret_var = Invoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Invoice_clone_ptr(uint32_t arg) { + LDKInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Invoice_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Invoice_clone(uint32_t orig) { LDKInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoice ret_var = Invoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28785,6 +34526,7 @@ void __attribute__((visibility("default"))) TS_SignedRawInvoice_free(uint32_t t LDKSignedRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); SignedRawInvoice_free(this_obj_conv); } @@ -28792,21 +34534,46 @@ jboolean __attribute__((visibility("default"))) TS_SignedRawInvoice_eq(uint32_t LDKSignedRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSignedRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = SignedRawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) { + LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_SignedRawInvoice_clone_ptr(uint32_t arg) { + LDKSignedRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = SignedRawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_clone(uint32_t orig) { LDKSignedRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28818,6 +34585,7 @@ void __attribute__((visibility("default"))) TS_RawInvoice_free(uint32_t this_ob LDKRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawInvoice_free(this_obj_conv); } @@ -28825,10 +34593,12 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_get_data(uint32_t LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28840,9 +34610,11 @@ void __attribute__((visibility("default"))) TS_RawInvoice_set_data(uint32_t thi LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RawDataPart_clone(&val_conv); RawInvoice_set_data(&this_ptr_conv, val_conv); } @@ -28851,21 +34623,46 @@ jboolean __attribute__((visibility("default"))) TS_RawInvoice_eq(uint32_t a, ui LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) { + LDKRawInvoice ret_var = RawInvoice_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RawInvoice_clone_ptr(uint32_t arg) { + LDKRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RawInvoice_clone(uint32_t orig) { LDKRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28877,6 +34674,7 @@ void __attribute__((visibility("default"))) TS_RawDataPart_free(uint32_t this_o LDKRawDataPart this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawDataPart_free(this_obj_conv); } @@ -28884,10 +34682,12 @@ uint32_t __attribute__((visibility("default"))) TS_RawDataPart_get_timestamp(ui LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28899,9 +34699,11 @@ void __attribute__((visibility("default"))) TS_RawDataPart_set_timestamp(uint32 LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = PositiveTimestamp_clone(&val_conv); RawDataPart_set_timestamp(&this_ptr_conv, val_conv); } @@ -28910,21 +34712,46 @@ jboolean __attribute__((visibility("default"))) TS_RawDataPart_eq(uint32_t a, u LDKRawDataPart a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawDataPart b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawDataPart_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) { + LDKRawDataPart ret_var = RawDataPart_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RawDataPart_clone_ptr(uint32_t arg) { + LDKRawDataPart arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawDataPart_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RawDataPart_clone(uint32_t orig) { LDKRawDataPart orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28936,6 +34763,7 @@ void __attribute__((visibility("default"))) TS_PositiveTimestamp_free(uint32_t LDKPositiveTimestamp this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PositiveTimestamp_free(this_obj_conv); } @@ -28943,21 +34771,46 @@ jboolean __attribute__((visibility("default"))) TS_PositiveTimestamp_eq(uint32_ LDKPositiveTimestamp a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPositiveTimestamp b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PositiveTimestamp_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) { + LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PositiveTimestamp_clone_ptr(uint32_t arg) { + LDKPositiveTimestamp arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PositiveTimestamp_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PositiveTimestamp_clone(uint32_t orig) { LDKPositiveTimestamp orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29052,17 +34905,41 @@ void __attribute__((visibility("default"))) TS_Sha256_free(uint32_t this_obj) { LDKSha256 this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Sha256_free(this_obj_conv); } +static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) { + LDKSha256 ret_var = Sha256_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Sha256_clone_ptr(uint32_t arg) { + LDKSha256 arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Sha256_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Sha256_clone(uint32_t orig) { LDKSha256 orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSha256 ret_var = Sha256_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29074,6 +34951,7 @@ int64_t __attribute__((visibility("default"))) TS_Sha256_hash(uint32_t o) { LDKSha256 o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Sha256_hash(&o_conv); return ret_val; } @@ -29082,9 +34960,11 @@ jboolean __attribute__((visibility("default"))) TS_Sha256_eq(uint32_t a, uint32 LDKSha256 a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSha256 b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Sha256_eq(&a_conv, &b_conv); return ret_val; } @@ -29093,17 +34973,41 @@ void __attribute__((visibility("default"))) TS_Description_free(uint32_t this_o LDKDescription this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Description_free(this_obj_conv); } +static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) { + LDKDescription ret_var = Description_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Description_clone_ptr(uint32_t arg) { + LDKDescription arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Description_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Description_clone(uint32_t orig) { LDKDescription orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDescription ret_var = Description_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29115,6 +35019,7 @@ int64_t __attribute__((visibility("default"))) TS_Description_hash(uint32_t o) LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Description_hash(&o_conv); return ret_val; } @@ -29123,9 +35028,11 @@ jboolean __attribute__((visibility("default"))) TS_Description_eq(uint32_t a, u LDKDescription a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKDescription b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Description_eq(&a_conv, &b_conv); return ret_val; } @@ -29134,6 +35041,7 @@ void __attribute__((visibility("default"))) TS_PayeePubKey_free(uint32_t this_o LDKPayeePubKey this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PayeePubKey_free(this_obj_conv); } @@ -29141,6 +35049,7 @@ int8_tArray __attribute__((visibility("default"))) TS_PayeePubKey_get_a(uint32_ LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33); return ret_arr; @@ -29150,6 +35059,7 @@ void __attribute__((visibility("default"))) TS_PayeePubKey_set_a(uint32_t this_ LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(*((uint32_t*)val) == 33); memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33); @@ -29164,6 +35074,7 @@ uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_new(int8_tArray uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29171,14 +35082,37 @@ uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_new(int8_tArray return ret_ref; } +static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) { + LDKPayeePubKey ret_var = PayeePubKey_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PayeePubKey_clone_ptr(uint32_t arg) { + LDKPayeePubKey arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PayeePubKey_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_clone(uint32_t orig) { LDKPayeePubKey orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29190,6 +35124,7 @@ int64_t __attribute__((visibility("default"))) TS_PayeePubKey_hash(uint32_t o) LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PayeePubKey_hash(&o_conv); return ret_val; } @@ -29198,9 +35133,11 @@ jboolean __attribute__((visibility("default"))) TS_PayeePubKey_eq(uint32_t a, u LDKPayeePubKey a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayeePubKey b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PayeePubKey_eq(&a_conv, &b_conv); return ret_val; } @@ -29209,17 +35146,41 @@ void __attribute__((visibility("default"))) TS_ExpiryTime_free(uint32_t this_ob LDKExpiryTime this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ExpiryTime_free(this_obj_conv); } +static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) { + LDKExpiryTime ret_var = ExpiryTime_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_ExpiryTime_clone_ptr(uint32_t arg) { + LDKExpiryTime arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ExpiryTime_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_ExpiryTime_clone(uint32_t orig) { LDKExpiryTime orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29231,6 +35192,7 @@ int64_t __attribute__((visibility("default"))) TS_ExpiryTime_hash(uint32_t o) { LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ExpiryTime_hash(&o_conv); return ret_val; } @@ -29239,9 +35201,11 @@ jboolean __attribute__((visibility("default"))) TS_ExpiryTime_eq(uint32_t a, ui LDKExpiryTime a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKExpiryTime b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ExpiryTime_eq(&a_conv, &b_conv); return ret_val; } @@ -29250,6 +35214,7 @@ void __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_free(uint32_t LDKMinFinalCltvExpiry this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MinFinalCltvExpiry_free(this_obj_conv); } @@ -29257,6 +35222,7 @@ int64_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_get_a(uint LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv); return ret_val; } @@ -29265,6 +35231,7 @@ void __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_set_a(uint32_ LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); MinFinalCltvExpiry_set_a(&this_ptr_conv, val); } @@ -29273,6 +35240,7 @@ uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_new(int64 uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29280,14 +35248,37 @@ uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_new(int64 return ret_ref; } +static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) { + LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_clone_ptr(uint32_t arg) { + LDKMinFinalCltvExpiry arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MinFinalCltvExpiry_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_clone(uint32_t orig) { LDKMinFinalCltvExpiry orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29299,6 +35290,7 @@ int64_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_hash(uint3 LDKMinFinalCltvExpiry o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MinFinalCltvExpiry_hash(&o_conv); return ret_val; } @@ -29307,9 +35299,11 @@ jboolean __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_eq(uint32 LDKMinFinalCltvExpiry a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMinFinalCltvExpiry b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MinFinalCltvExpiry_eq(&a_conv, &b_conv); return ret_val; } @@ -29323,6 +35317,18 @@ void __attribute__((visibility("default"))) TS_Fallback_free(uint32_t this_ptr) Fallback_free(this_ptr_conv); } +static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) { + LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); + *ret_copy = Fallback_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_Fallback_clone_ptr(uint32_t arg) { + LDKFallback* arg_conv = (LDKFallback*)arg; + int64_t ret_val = Fallback_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_Fallback_clone(uint32_t orig) { LDKFallback* orig_conv = (LDKFallback*)orig; LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); @@ -29380,17 +35386,41 @@ void __attribute__((visibility("default"))) TS_InvoiceSignature_free(uint32_t t LDKInvoiceSignature this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceSignature_free(this_obj_conv); } +static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) { + LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_InvoiceSignature_clone_ptr(uint32_t arg) { + LDKInvoiceSignature arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceSignature_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_InvoiceSignature_clone(uint32_t orig) { LDKInvoiceSignature orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29402,9 +35432,11 @@ jboolean __attribute__((visibility("default"))) TS_InvoiceSignature_eq(uint32_t LDKInvoiceSignature a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceSignature b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceSignature_eq(&a_conv, &b_conv); return ret_val; } @@ -29413,17 +35445,41 @@ void __attribute__((visibility("default"))) TS_PrivateRoute_free(uint32_t this_ LDKPrivateRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PrivateRoute_free(this_obj_conv); } +static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) { + LDKPrivateRoute ret_var = PrivateRoute_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PrivateRoute_clone_ptr(uint32_t arg) { + LDKPrivateRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PrivateRoute_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PrivateRoute_clone(uint32_t orig) { LDKPrivateRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29435,6 +35491,7 @@ int64_t __attribute__((visibility("default"))) TS_PrivateRoute_hash(uint32_t o) LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PrivateRoute_hash(&o_conv); return ret_val; } @@ -29443,9 +35500,11 @@ jboolean __attribute__((visibility("default"))) TS_PrivateRoute_eq(uint32_t a, LDKPrivateRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPrivateRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PrivateRoute_eq(&a_conv, &b_conv); return ret_val; } @@ -29454,6 +35513,7 @@ uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_into_parts( LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = SignedRawInvoice_clone(&this_arg_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = SignedRawInvoice_into_parts(this_arg_conv); @@ -29464,10 +35524,12 @@ uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_raw_invoice LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29479,6 +35541,7 @@ int8_tArray __attribute__((visibility("default"))) TS_SignedRawInvoice_hash(uin LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *SignedRawInvoice_hash(&this_arg_conv), 32); return ret_arr; @@ -29488,10 +35551,12 @@ uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_signature(u LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29503,6 +35568,7 @@ uint32_t __attribute__((visibility("default"))) TS_SignedRawInvoice_recover_pay LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv); return (uint64_t)ret_conv; @@ -29512,6 +35578,7 @@ jboolean __attribute__((visibility("default"))) TS_SignedRawInvoice_check_signa LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = SignedRawInvoice_check_signature(&this_arg_conv); return ret_val; } @@ -29520,6 +35587,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RawInvoice_hash(uint32_t LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RawInvoice_hash(&this_arg_conv).data, 32); return ret_arr; @@ -29529,11 +35597,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_payment_hash(uint LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29546,11 +35616,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_description(uint3 LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDescription ret_var = RawInvoice_description(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29563,11 +35635,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_payee_pub_key(uin LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29580,11 +35654,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_description_hash( LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29597,11 +35673,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_expiry_time(uint3 LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29614,11 +35692,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_min_final_cltv_ex LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29631,6 +35711,7 @@ int8_tArray __attribute__((visibility("default"))) TS_RawInvoice_payment_secret LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), RawInvoice_payment_secret(&this_arg_conv).data, 32); return ret_arr; @@ -29640,11 +35721,13 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_features(uint32_t LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29657,6 +35740,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RawInvoice_private_rout LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -29666,6 +35750,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_RawInvoice_private_rout uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -29681,6 +35766,7 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_amount_pico_btc(u LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -29691,6 +35777,7 @@ uint32_t __attribute__((visibility("default"))) TS_RawInvoice_currency(uint32_t LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); uint32_t ret_conv = LDKCurrency_to_js(RawInvoice_currency(&this_arg_conv)); return ret_conv; } @@ -29711,6 +35798,7 @@ int64_t __attribute__((visibility("default"))) TS_PositiveTimestamp_as_unix_tim LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_unix_timestamp(&this_arg_conv); return ret_val; } @@ -29719,6 +35807,7 @@ int64_t __attribute__((visibility("default"))) TS_PositiveTimestamp_as_time(uin LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_time(&this_arg_conv); return ret_val; } @@ -29727,11 +35816,13 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_into_signed_raw(uint LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Invoice_clone(&this_arg_conv); LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29743,6 +35834,7 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_check_signature(uint LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); *ret_conv = Invoice_check_signature(&this_arg_conv); return (uint64_t)ret_conv; @@ -29752,6 +35844,7 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_from_signed(uint32_t LDKSignedRawInvoice signed_invoice_conv; signed_invoice_conv.inner = (void*)(signed_invoice & (~1)); signed_invoice_conv.is_owned = (signed_invoice & 1) || (signed_invoice == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv); signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = Invoice_from_signed(signed_invoice_conv); @@ -29762,6 +35855,7 @@ int64_t __attribute__((visibility("default"))) TS_Invoice_timestamp(uint32_t th LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_timestamp(&this_arg_conv); return ret_val; } @@ -29770,6 +35864,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Invoice_payment_hash(uint LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *Invoice_payment_hash(&this_arg_conv), 32); return ret_arr; @@ -29779,6 +35874,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Invoice_payee_pub_key(uin LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), Invoice_payee_pub_key(&this_arg_conv).compressed_form, 33); return ret_arr; @@ -29788,6 +35884,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Invoice_payment_secret(ui LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), *Invoice_payment_secret(&this_arg_conv), 32); return ret_arr; @@ -29797,11 +35894,13 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_features(uint32_t th LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29814,6 +35913,7 @@ int8_tArray __attribute__((visibility("default"))) TS_Invoice_recover_payee_pub LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes"); memcpy((uint8_t*)(ret_arr + 4), Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form, 33); return ret_arr; @@ -29823,6 +35923,7 @@ int64_t __attribute__((visibility("default"))) TS_Invoice_expiry_time(uint32_t LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_expiry_time(&this_arg_conv); return ret_val; } @@ -29831,6 +35932,7 @@ jboolean __attribute__((visibility("default"))) TS_Invoice_is_expired(uint32_t LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = Invoice_is_expired(&this_arg_conv); return ret_val; } @@ -29839,6 +35941,7 @@ int64_t __attribute__((visibility("default"))) TS_Invoice_min_final_cltv_expiry LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_min_final_cltv_expiry(&this_arg_conv); return ret_val; } @@ -29847,6 +35950,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Invoice_private_routes( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -29856,6 +35960,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Invoice_private_routes( uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -29871,6 +35976,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Invoice_route_hints(uin LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv); uint32_tArray ret_arr = NULL; ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes"); @@ -29880,6 +35986,7 @@ uint32_tArray __attribute__((visibility("default"))) TS_Invoice_route_hints(uin uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -29895,6 +36002,7 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_currency(uint32_t th LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); uint32_t ret_conv = LDKCurrency_to_js(Invoice_currency(&this_arg_conv)); return ret_conv; } @@ -29903,6 +36011,7 @@ uint32_t __attribute__((visibility("default"))) TS_Invoice_amount_milli_satoshi LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -29920,6 +36029,7 @@ jstring __attribute__((visibility("default"))) TS_Description_into_inner(uint32 LDKDescription this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Description_clone(&this_arg_conv); LDKStr ret_str = Description_into_inner(this_arg_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); @@ -29943,6 +36053,7 @@ int64_t __attribute__((visibility("default"))) TS_ExpiryTime_as_seconds(uint32_ LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_seconds(&this_arg_conv); return ret_val; } @@ -29951,6 +36062,7 @@ int64_t __attribute__((visibility("default"))) TS_ExpiryTime_as_duration(uint32 LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_duration(&this_arg_conv); return ret_val; } @@ -29959,6 +36071,7 @@ uint32_t __attribute__((visibility("default"))) TS_PrivateRoute_new(uint32_t ho LDKRouteHint hops_conv; hops_conv.inner = (void*)(hops & (~1)); hops_conv.is_owned = (hops & 1) || (hops == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv); hops_conv = RouteHint_clone(&hops_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = PrivateRoute_new(hops_conv); @@ -29969,11 +36082,13 @@ uint32_t __attribute__((visibility("default"))) TS_PrivateRoute_into_inner(uint LDKPrivateRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = PrivateRoute_clone(&this_arg_conv); LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30102,6 +36217,18 @@ void __attribute__((visibility("default"))) TS_SignOrCreationError_free(uint32_ SignOrCreationError_free(this_ptr_conv); } +static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) { + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = SignOrCreationError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_SignOrCreationError_clone_ptr(uint32_t arg) { + LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)arg; + int64_t ret_val = SignOrCreationError_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_SignOrCreationError_clone(uint32_t orig) { LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)orig; LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); @@ -30144,6 +36271,7 @@ void __attribute__((visibility("default"))) TS_InvoicePayer_free(uint32_t this_ LDKInvoicePayer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoicePayer_free(this_obj_conv); } @@ -30169,6 +36297,7 @@ void __attribute__((visibility("default"))) TS_RetryAttempts_free(uint32_t this LDKRetryAttempts this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RetryAttempts_free(this_obj_conv); } @@ -30176,6 +36305,7 @@ int64_t __attribute__((visibility("default"))) TS_RetryAttempts_get_a(uint32_t LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv); return ret_val; } @@ -30184,6 +36314,7 @@ void __attribute__((visibility("default"))) TS_RetryAttempts_set_a(uint32_t thi LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RetryAttempts_set_a(&this_ptr_conv, val); } @@ -30192,6 +36323,7 @@ uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_new(int64_t a_ uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30199,14 +36331,37 @@ uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_new(int64_t a_ return ret_ref; } +static inline uint64_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg) { + LDKRetryAttempts ret_var = RetryAttempts_clone(arg); +uint64_t ret_ref = 0; +CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uint64_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_RetryAttempts_clone_ptr(uint32_t arg) { + LDKRetryAttempts arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RetryAttempts_clone_ptr(&arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_clone(uint32_t orig) { LDKRetryAttempts orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRetryAttempts ret_var = RetryAttempts_clone(&orig_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30218,9 +36373,11 @@ jboolean __attribute__((visibility("default"))) TS_RetryAttempts_eq(uint32_t a, LDKRetryAttempts a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRetryAttempts b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv); return ret_val; } @@ -30229,6 +36386,7 @@ int64_t __attribute__((visibility("default"))) TS_RetryAttempts_hash(uint32_t o LDKRetryAttempts o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RetryAttempts_hash(&o_conv); return ret_val; } @@ -30242,6 +36400,18 @@ void __attribute__((visibility("default"))) TS_PaymentError_free(uint32_t this_ PaymentError_free(this_ptr_conv); } +static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) { + LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); + *ret_copy = PaymentError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +int64_t __attribute__((visibility("default"))) TS_PaymentError_clone_ptr(uint32_t arg) { + LDKPaymentError* arg_conv = (LDKPaymentError*)arg; + int64_t ret_val = PaymentError_clone_ptr(arg_conv); + return ret_val; +} + uint32_t __attribute__((visibility("default"))) TS_PaymentError_clone(uint32_t orig) { LDKPaymentError* orig_conv = (LDKPaymentError*)orig; LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); @@ -30262,6 +36432,7 @@ uint32_t __attribute__((visibility("default"))) TS_PaymentError_routing(uint32_ LDKLightningError a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = LightningError_clone(&a_conv); LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); *ret_copy = PaymentError_routing(a_conv); @@ -30290,6 +36461,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_new(uint32_t pa LDKLockableScore scorer_conv; scorer_conv.inner = (void*)(scorer & (~1)); scorer_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -30299,11 +36471,13 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_new(uint32_t pa LDKRetryAttempts retry_attempts_conv; retry_attempts_conv.inner = (void*)(retry_attempts & (~1)); retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_attempts_conv); retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv); LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_conv); uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30315,9 +36489,11 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_invoice(uin LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv); return (uint64_t)ret_conv; @@ -30327,9 +36503,11 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_zero_value_ LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats); return (uint64_t)ret_conv; @@ -30339,6 +36517,7 @@ void __attribute__((visibility("default"))) TS_InvoicePayer_remove_cached_payme LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK(*((uint32_t*)payment_hash) == 32); memcpy(payment_hash_arr, (uint8_t*)(payment_hash + 4), 32); @@ -30350,6 +36529,7 @@ uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_as_EventHandler LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -30359,6 +36539,7 @@ uint32_t __attribute__((visibility("default"))) TS_create_invoice_from_channelm LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -30377,6 +36558,7 @@ void __attribute__((visibility("default"))) TS_DefaultRouter_free(uint32_t this LDKDefaultRouter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DefaultRouter_free(this_obj_conv); } @@ -30384,6 +36566,7 @@ uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_new(uint32_t n LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -30391,6 +36574,7 @@ uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_new(uint32_t n uint64_t ret_ref = 0; CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30402,6 +36586,7 @@ uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_as_Router(uint LDKDefaultRouter this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); *ret_ret = DefaultRouter_as_Router(&this_arg_conv); return (uint64_t)ret_ret; @@ -30411,6 +36596,7 @@ uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Payer(uint LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer"); *ret_ret = ChannelManager_as_Payer(&this_arg_conv); return (uint64_t)ret_ret; @@ -30441,6 +36627,7 @@ jstring __attribute__((visibility("default"))) TS_Invoice_to_str(uint32_t o) { LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = Invoice_to_str(&o_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); @@ -30451,6 +36638,7 @@ jstring __attribute__((visibility("default"))) TS_SignedRawInvoice_to_str(uint3 LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = SignedRawInvoice_to_str(&o_conv); jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); Str_free(ret_str); diff --git a/ts/bindings.ts b/ts/bindings.ts index 12570922..045a1f35 100644 --- a/ts/bindings.ts +++ b/ts/bindings.ts @@ -151,7 +151,6 @@ public static native long vec_slice_len(long vec); public static native long new_empty_slice_vec(); */ - public static native long LDKCVec_u8Z_new(number[] elems); // struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) export function TxOut_get_script_pubkey(thing: number): Uint8Array { if(!isWasmInitialized) { @@ -168,19 +167,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.TxOut_get_value(thing); return nativeResponseValue; } - public static native boolean LDKCResult_SecretKeyErrorZ_result_ok(long arg); public static native Uint8Array LDKCResult_SecretKeyErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_SecretKeyErrorZ_get_err(long arg); - public static native boolean LDKCResult_PublicKeyErrorZ_result_ok(long arg); public static native Uint8Array LDKCResult_PublicKeyErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_PublicKeyErrorZ_get_err(long arg); - public static native boolean LDKCResult_TxCreationKeysDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_TxCreationKeysDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_TxCreationKeysDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelPublicKeysDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelPublicKeysDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_TxCreationKeysErrorZ_result_ok(long arg); public static native number LDKCResult_TxCreationKeysErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_TxCreationKeysErrorZ_get_err(long arg); public static class LDKCOption_u32Z { @@ -196,53 +190,36 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_u32Z.init(); } public static native LDKCOption_u32Z LDKCOption_u32Z_ref_from_ptr(long ptr); - public static native boolean LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_TrustedClosingTransactionNoneZ_result_ok(long arg); public static native number LDKCResult_TrustedClosingTransactionNoneZ_get_ok(long arg); public static native void LDKCResult_TrustedClosingTransactionNoneZ_get_err(long arg); - public static native boolean LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_CommitmentTransactionDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(long arg); public static native number LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(long arg); public static native void LDKCResult_TrustedCommitmentTransactionNoneZ_get_err(long arg); - public static native boolean LDKCResult_CVec_SignatureZNoneZ_result_ok(long arg); public static native Uint8Array[] LDKCResult_CVec_SignatureZNoneZ_get_ok(long arg); public static native void LDKCResult_CVec_SignatureZNoneZ_get_err(long arg); - public static native boolean LDKCResult_ShutdownScriptDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ShutdownScriptDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ShutdownScriptDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(long arg); public static native number LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(long arg); public static native number LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_err(long arg); - public static native boolean LDKCResult_NoneErrorZ_result_ok(long arg); public static native void LDKCResult_NoneErrorZ_get_ok(long arg); public static native IOError LDKCResult_NoneErrorZ_get_err(long arg); - public static native boolean LDKCResult_RouteHopDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_RouteHopDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_RouteHopDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_RouteHopZ_new(number[] elems); - public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_RouteDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_RouteDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RouteParametersDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_RouteParametersDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_RouteParametersDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_RouteHintZ_new(number[] elems); public static class LDKCOption_u64Z { private LDKCOption_u64Z() {} export class Some extends LDKCOption_u64Z { @@ -256,21 +233,14 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_u64Z.init(); } public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr); - public static native boolean LDKCResult_PayeeDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_PayeeDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_PayeeDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_RouteHintHopZ_new(number[] elems); - public static native boolean LDKCResult_RouteHintDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_RouteHintDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_RouteHintDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RouteHintHopDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_RouteHintHopDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_RouteHintHopDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_ChannelDetailsZ_new(number[] elems); - public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg); public static native number LDKCResult_RouteLightningErrorZ_get_ok(long arg); public static native number LDKCResult_RouteLightningErrorZ_get_err(long arg); - public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg); public static native number LDKCResult_TxOutAccessErrorZ_get_ok(long arg); public static native AccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg); // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple); @@ -289,8 +259,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_usizeTransactionZ_get_b(tuple); return decodeArray(nativeResponseValue); } - public static native long LDKCVec_C2Tuple_usizeTransactionZZ_new(number[] elems); - public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg); public static native void LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg); public static native ChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg); public static class LDKMonitorEvent { @@ -316,7 +284,6 @@ public static native long new_empty_slice_vec(); } static { LDKMonitorEvent.init(); } public static native LDKMonitorEvent LDKMonitorEvent_ref_from_ptr(long ptr); - public static native long LDKCVec_MonitorEventZ_new(number[] elems); public static class LDKCOption_C2Tuple_usizeTransactionZZ { private LDKCOption_C2Tuple_usizeTransactionZZ() {} export class Some extends LDKCOption_C2Tuple_usizeTransactionZZ { @@ -330,6 +297,50 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_C2Tuple_usizeTransactionZZ.init(); } public static native LDKCOption_C2Tuple_usizeTransactionZZ LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(long ptr); + public static class LDKClosureReason { + private LDKClosureReason() {} + export class CounterpartyForceClosed extends LDKClosureReason { + public String peer_msg; + CounterpartyForceClosed(String peer_msg) { this.peer_msg = peer_msg; } + } + export class HolderForceClosed extends LDKClosureReason { + HolderForceClosed() { } + } + export class CooperativeClosure extends LDKClosureReason { + CooperativeClosure() { } + } + export class CommitmentTxConfirmed extends LDKClosureReason { + CommitmentTxConfirmed() { } + } + export class ProcessingError extends LDKClosureReason { + public String err; + ProcessingError(String err) { this.err = err; } + } + export class DisconnectedPeer extends LDKClosureReason { + DisconnectedPeer() { } + } + export class OutdatedChannelManager extends LDKClosureReason { + OutdatedChannelManager() { } + } + static native void init(); + } + static { LDKClosureReason.init(); } + public static native LDKClosureReason LDKClosureReason_ref_from_ptr(long ptr); + public static class LDKCOption_ClosureReasonZ { + private LDKCOption_ClosureReasonZ() {} + export class Some extends LDKCOption_ClosureReasonZ { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_ClosureReasonZ { + None() { } + } + static native void init(); + } + static { LDKCOption_ClosureReasonZ.init(); } + public static native LDKCOption_ClosureReasonZ LDKCOption_ClosureReasonZ_ref_from_ptr(long ptr); + public static native number LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_err(long arg); public static class LDKNetworkUpdate { private LDKNetworkUpdate() {} export class ChannelUpdateMessage extends LDKNetworkUpdate { @@ -382,7 +393,98 @@ public static native long new_empty_slice_vec(); } static { LDKSpendableOutputDescriptor.init(); } public static native LDKSpendableOutputDescriptor LDKSpendableOutputDescriptor_ref_from_ptr(long ptr); - public static native long LDKCVec_SpendableOutputDescriptorZ_new(number[] elems); + public static class LDKPaymentPurpose { + private LDKPaymentPurpose() {} + export class InvoicePayment extends LDKPaymentPurpose { + public Uint8Array payment_preimage; + public Uint8Array payment_secret; + public number user_payment_id; + InvoicePayment(Uint8Array payment_preimage, Uint8Array payment_secret, number user_payment_id) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.user_payment_id = user_payment_id; } + } + export class SpontaneousPayment extends LDKPaymentPurpose { + public Uint8Array spontaneous_payment; + SpontaneousPayment(Uint8Array spontaneous_payment) { this.spontaneous_payment = spontaneous_payment; } + } + static native void init(); + } + static { LDKPaymentPurpose.init(); } + public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr); + public static class LDKEvent { + private LDKEvent() {} + export class FundingGenerationReady extends LDKEvent { + public Uint8Array temporary_channel_id; + public number channel_value_satoshis; + public Uint8Array output_script; + public number user_channel_id; + FundingGenerationReady(Uint8Array temporary_channel_id, number channel_value_satoshis, Uint8Array output_script, number user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } + } + export class PaymentReceived extends LDKEvent { + public Uint8Array payment_hash; + public number amt; + public number purpose; + PaymentReceived(Uint8Array payment_hash, number amt, number purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; } + } + export class PaymentSent extends LDKEvent { + public Uint8Array payment_id; + public Uint8Array payment_preimage; + public Uint8Array payment_hash; + public number fee_paid_msat; + PaymentSent(Uint8Array payment_id, Uint8Array payment_preimage, Uint8Array payment_hash, number fee_paid_msat) { this.payment_id = payment_id; this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; this.fee_paid_msat = fee_paid_msat; } + } + export class PaymentPathFailed extends LDKEvent { + public Uint8Array payment_id; + public Uint8Array payment_hash; + public boolean rejected_by_dest; + public number network_update; + public boolean all_paths_failed; + public number[] path; + public number short_channel_id; + public number retry; + PaymentPathFailed(Uint8Array payment_id, Uint8Array payment_hash, boolean rejected_by_dest, number network_update, boolean all_paths_failed, number[] path, number short_channel_id, number retry) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; this.network_update = network_update; this.all_paths_failed = all_paths_failed; this.path = path; this.short_channel_id = short_channel_id; this.retry = retry; } + } + export class PendingHTLCsForwardable extends LDKEvent { + public number time_forwardable; + PendingHTLCsForwardable(number time_forwardable) { this.time_forwardable = time_forwardable; } + } + export class SpendableOutputs extends LDKEvent { + public number[] outputs; + SpendableOutputs(number[] outputs) { this.outputs = outputs; } + } + export class PaymentForwarded extends LDKEvent { + public number fee_earned_msat; + public boolean claim_from_onchain_tx; + PaymentForwarded(number fee_earned_msat, boolean claim_from_onchain_tx) { this.fee_earned_msat = fee_earned_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; } + } + export class ChannelClosed extends LDKEvent { + public Uint8Array channel_id; + public number user_channel_id; + public number reason; + ChannelClosed(Uint8Array channel_id, number user_channel_id, number reason) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; } + } + export class DiscardFunding extends LDKEvent { + public Uint8Array channel_id; + public Uint8Array transaction; + DiscardFunding(Uint8Array channel_id, Uint8Array transaction) { this.channel_id = channel_id; this.transaction = transaction; } + } + static native void init(); + } + static { LDKEvent.init(); } + public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); + public static class LDKCOption_EventZ { + private LDKCOption_EventZ() {} + export class Some extends LDKCOption_EventZ { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_EventZ { + None() { } + } + static native void init(); + } + static { LDKCOption_EventZ.init(); } + public static native LDKCOption_EventZ LDKCOption_EventZ_ref_from_ptr(long ptr); + public static native number LDKCResult_COption_EventZDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_COption_EventZDecodeErrorZ_get_err(long arg); public static class LDKErrorAction { private LDKErrorAction() {} export class DisconnectPeer extends LDKErrorAction { @@ -503,35 +605,24 @@ public static native long new_empty_slice_vec(); } static { LDKMessageSendEvent.init(); } public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr); - public static native long LDKCVec_MessageSendEventZ_new(number[] elems); - public static native boolean LDKCResult_InitFeaturesDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_InitFeaturesDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_InitFeaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NodeFeaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ScoringParametersDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ScoringParametersDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ScoringParametersDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ScorerDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ScorerDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ScorerDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NoneNoneZ_result_ok(long arg); public static native void LDKCResult_NoneNoneZ_get_ok(long arg); public static native void LDKCResult_NoneNoneZ_get_err(long arg); // struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple); @@ -550,10 +641,8 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_SignatureCVec_SignatureZZ_get_b(tuple); return nativeResponseValue; } - public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg); public static native number LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long arg); public static native void LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long arg); - public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg); public static native Uint8Array LDKCResult_SignatureNoneZ_get_ok(long arg); public static native void LDKCResult_SignatureNoneZ_get_err(long arg); @@ -720,20 +809,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sign_write(this_arg); return decodeArray(nativeResponseValue); } - public static native boolean LDKCResult_SignDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_SignDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_SignDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RecoverableSignatureNoneZ_result_ok(long arg); public static native Uint8Array LDKCResult_RecoverableSignatureNoneZ_get_ok(long arg); public static native void LDKCResult_RecoverableSignatureNoneZ_get_err(long arg); - public static native boolean LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(long arg); public static native Uint8Array[] LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(long arg); public static native void LDKCResult_CVec_CVec_u8ZZNoneZ_get_err(long arg); - public static native boolean LDKCResult_InMemorySignerDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_InMemorySignerDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_InMemorySignerDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_TxOutZ_new(number[] elems); - public static native boolean LDKCResult_TransactionNoneZ_result_ok(long arg); public static native Uint8Array LDKCResult_TransactionNoneZ_get_ok(long arg); public static native void LDKCResult_TransactionNoneZ_get_err(long arg); // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple); @@ -752,8 +835,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_BlockHashChannelMonitorZ_get_b(tuple); return nativeResponseValue; } - public static native long LDKCVec_C2Tuple_BlockHashChannelMonitorZZ_new(number[] elems); - public static native boolean LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(long arg); public static native number[] LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(long arg); public static native IOError LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(long arg); public static class LDKCOption_u16Z { @@ -799,12 +880,8 @@ public static native long new_empty_slice_vec(); } static { LDKAPIError.init(); } public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr); - public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg); public static native void LDKCResult_NoneAPIErrorZ_get_ok(long arg); public static native number LDKCResult_NoneAPIErrorZ_get_err(long arg); - public static native long LDKCVec_CResult_NoneAPIErrorZZ_new(number[] elems); - public static native long LDKCVec_APIErrorZ_new(number[] elems); - public static native boolean LDKCResult__u832APIErrorZ_result_ok(long arg); public static native Uint8Array LDKCResult__u832APIErrorZ_get_ok(long arg); public static native number LDKCResult__u832APIErrorZ_get_err(long arg); public static class LDKPaymentSendFailure { @@ -831,10 +908,8 @@ public static native long new_empty_slice_vec(); } static { LDKPaymentSendFailure.init(); } public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr); - public static native boolean LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(long arg); public static native Uint8Array LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(long arg); public static native number LDKCResult_PaymentIdPaymentSendFailureZ_get_err(long arg); - public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg); public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg); public static native number LDKCResult_NonePaymentSendFailureZ_get_err(long arg); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple); @@ -853,7 +928,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_get_b(tuple); return decodeArray(nativeResponseValue); } - public static native boolean LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(long arg); public static native number LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(long arg); public static native number LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(long arg); public static class LDKNetAddress { @@ -884,7 +958,6 @@ public static native long new_empty_slice_vec(); } static { LDKNetAddress.init(); } public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); - public static native long LDKCVec_NetAddressZ_new(number[] elems); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple); export function C2Tuple_PaymentHashPaymentSecretZ_get_a(tuple: number): Uint8Array { if(!isWasmInitialized) { @@ -901,10 +974,8 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentSecretZ_get_b(tuple); return decodeArray(nativeResponseValue); } - public static native boolean LDKCResult_PaymentSecretAPIErrorZ_result_ok(long arg); public static native Uint8Array LDKCResult_PaymentSecretAPIErrorZ_get_ok(long arg); public static native number LDKCResult_PaymentSecretAPIErrorZ_get_err(long arg); - public static native long LDKCVec_ChannelMonitorZ_new(number[] elems); @@ -1079,7 +1150,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START export interface LDKLogger { - log (record: String): void; + log (record: number): void; } export function LDKLogger_new(impl: LDKLogger): number { @@ -1105,13 +1176,10 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_BlockHashChannelManagerZ_get_b(tuple); return nativeResponseValue; } - public static native boolean LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelConfigDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelConfigDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelConfigDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_OutPointDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_OutPointDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_OutPointDecodeErrorZ_get_err(long arg); @@ -1169,7 +1237,6 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_TypeZ.init(); } public static native LDKCOption_TypeZ LDKCOption_TypeZ_ref_from_ptr(long ptr); - public static native boolean LDKCResult_COption_TypeZDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_COption_TypeZDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_COption_TypeZDecodeErrorZ_get_err(long arg); public static class LDKPaymentError { @@ -1190,16 +1257,12 @@ public static native long new_empty_slice_vec(); } static { LDKPaymentError.init(); } public static native LDKPaymentError LDKPaymentError_ref_from_ptr(long ptr); - public static native boolean LDKCResult_PaymentIdPaymentErrorZ_result_ok(long arg); public static native Uint8Array LDKCResult_PaymentIdPaymentErrorZ_get_ok(long arg); public static native number LDKCResult_PaymentIdPaymentErrorZ_get_err(long arg); - public static native boolean LDKCResult_SiPrefixNoneZ_result_ok(long arg); public static native SiPrefix LDKCResult_SiPrefixNoneZ_get_ok(long arg); public static native void LDKCResult_SiPrefixNoneZ_get_err(long arg); - public static native boolean LDKCResult_InvoiceNoneZ_result_ok(long arg); public static native number LDKCResult_InvoiceNoneZ_get_ok(long arg); public static native void LDKCResult_InvoiceNoneZ_get_err(long arg); - public static native boolean LDKCResult_SignedRawInvoiceNoneZ_result_ok(long arg); public static native number LDKCResult_SignedRawInvoiceNoneZ_get_ok(long arg); public static native void LDKCResult_SignedRawInvoiceNoneZ_get_err(long arg); // struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple); @@ -1226,38 +1289,41 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(tuple); return nativeResponseValue; } - public static native boolean LDKCResult_PayeePubKeyErrorZ_result_ok(long arg); public static native number LDKCResult_PayeePubKeyErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_PayeePubKeyErrorZ_get_err(long arg); - public static native long LDKCVec_PrivateRouteZ_new(number[] elems); - public static native boolean LDKCResult_PositiveTimestampCreationErrorZ_result_ok(long arg); public static native number LDKCResult_PositiveTimestampCreationErrorZ_get_ok(long arg); public static native CreationError LDKCResult_PositiveTimestampCreationErrorZ_get_err(long arg); - public static native boolean LDKCResult_NoneSemanticErrorZ_result_ok(long arg); public static native void LDKCResult_NoneSemanticErrorZ_get_ok(long arg); public static native SemanticError LDKCResult_NoneSemanticErrorZ_get_err(long arg); - public static native boolean LDKCResult_InvoiceSemanticErrorZ_result_ok(long arg); public static native number LDKCResult_InvoiceSemanticErrorZ_get_ok(long arg); public static native SemanticError LDKCResult_InvoiceSemanticErrorZ_get_err(long arg); - public static native boolean LDKCResult_DescriptionCreationErrorZ_result_ok(long arg); public static native number LDKCResult_DescriptionCreationErrorZ_get_ok(long arg); public static native CreationError LDKCResult_DescriptionCreationErrorZ_get_err(long arg); - public static native boolean LDKCResult_ExpiryTimeCreationErrorZ_result_ok(long arg); public static native number LDKCResult_ExpiryTimeCreationErrorZ_get_ok(long arg); public static native CreationError LDKCResult_ExpiryTimeCreationErrorZ_get_err(long arg); - public static native boolean LDKCResult_PrivateRouteCreationErrorZ_result_ok(long arg); public static native number LDKCResult_PrivateRouteCreationErrorZ_get_ok(long arg); public static native CreationError LDKCResult_PrivateRouteCreationErrorZ_get_err(long arg); - public static native boolean LDKCResult_StringErrorZ_result_ok(long arg); public static native String LDKCResult_StringErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_StringErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(long arg); + public static class LDKCOption_MonitorEventZ { + private LDKCOption_MonitorEventZ() {} + export class Some extends LDKCOption_MonitorEventZ { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_MonitorEventZ { + None() { } + } + static native void init(); + } + static { LDKCOption_MonitorEventZ.init(); } + public static native LDKCOption_MonitorEventZ LDKCOption_MonitorEventZ_ref_from_ptr(long ptr); + public static native number LDKCResult_COption_MonitorEventZDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err(long arg); public static native number LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_HTLCUpdateDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg); public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg); public static native number LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg); // struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple); @@ -1292,7 +1358,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_u32ScriptZ_get_b(tuple); return decodeArray(nativeResponseValue); } - public static native long LDKCVec_C2Tuple_u32ScriptZZ_new(number[] elems); // struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple); export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(tuple: number): Uint8Array { if(!isWasmInitialized) { @@ -1309,114 +1374,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(tuple); return nativeResponseValue; } - public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(number[] elems); - public static class LDKPaymentPurpose { - private LDKPaymentPurpose() {} - export class InvoicePayment extends LDKPaymentPurpose { - public Uint8Array payment_preimage; - public Uint8Array payment_secret; - public number user_payment_id; - InvoicePayment(Uint8Array payment_preimage, Uint8Array payment_secret, number user_payment_id) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.user_payment_id = user_payment_id; } - } - export class SpontaneousPayment extends LDKPaymentPurpose { - public Uint8Array spontaneous_payment; - SpontaneousPayment(Uint8Array spontaneous_payment) { this.spontaneous_payment = spontaneous_payment; } - } - static native void init(); - } - static { LDKPaymentPurpose.init(); } - public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr); - public static class LDKClosureReason { - private LDKClosureReason() {} - export class CounterpartyForceClosed extends LDKClosureReason { - public String peer_msg; - CounterpartyForceClosed(String peer_msg) { this.peer_msg = peer_msg; } - } - export class HolderForceClosed extends LDKClosureReason { - HolderForceClosed() { } - } - export class CooperativeClosure extends LDKClosureReason { - CooperativeClosure() { } - } - export class CommitmentTxConfirmed extends LDKClosureReason { - CommitmentTxConfirmed() { } - } - export class ProcessingError extends LDKClosureReason { - public String err; - ProcessingError(String err) { this.err = err; } - } - export class DisconnectedPeer extends LDKClosureReason { - DisconnectedPeer() { } - } - export class OutdatedChannelManager extends LDKClosureReason { - OutdatedChannelManager() { } - } - static native void init(); - } - static { LDKClosureReason.init(); } - public static native LDKClosureReason LDKClosureReason_ref_from_ptr(long ptr); - public static class LDKEvent { - private LDKEvent() {} - export class FundingGenerationReady extends LDKEvent { - public Uint8Array temporary_channel_id; - public number channel_value_satoshis; - public Uint8Array output_script; - public number user_channel_id; - FundingGenerationReady(Uint8Array temporary_channel_id, number channel_value_satoshis, Uint8Array output_script, number user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } - } - export class PaymentReceived extends LDKEvent { - public Uint8Array payment_hash; - public number amt; - public number purpose; - PaymentReceived(Uint8Array payment_hash, number amt, number purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; } - } - export class PaymentSent extends LDKEvent { - public Uint8Array payment_id; - public Uint8Array payment_preimage; - public Uint8Array payment_hash; - public number fee_paid_msat; - PaymentSent(Uint8Array payment_id, Uint8Array payment_preimage, Uint8Array payment_hash, number fee_paid_msat) { this.payment_id = payment_id; this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; this.fee_paid_msat = fee_paid_msat; } - } - export class PaymentPathFailed extends LDKEvent { - public Uint8Array payment_id; - public Uint8Array payment_hash; - public boolean rejected_by_dest; - public number network_update; - public boolean all_paths_failed; - public number[] path; - public number short_channel_id; - public number retry; - PaymentPathFailed(Uint8Array payment_id, Uint8Array payment_hash, boolean rejected_by_dest, number network_update, boolean all_paths_failed, number[] path, number short_channel_id, number retry) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; this.network_update = network_update; this.all_paths_failed = all_paths_failed; this.path = path; this.short_channel_id = short_channel_id; this.retry = retry; } - } - export class PendingHTLCsForwardable extends LDKEvent { - public number time_forwardable; - PendingHTLCsForwardable(number time_forwardable) { this.time_forwardable = time_forwardable; } - } - export class SpendableOutputs extends LDKEvent { - public number[] outputs; - SpendableOutputs(number[] outputs) { this.outputs = outputs; } - } - export class PaymentForwarded extends LDKEvent { - public number fee_earned_msat; - public boolean claim_from_onchain_tx; - PaymentForwarded(number fee_earned_msat, boolean claim_from_onchain_tx) { this.fee_earned_msat = fee_earned_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; } - } - export class ChannelClosed extends LDKEvent { - public Uint8Array channel_id; - public number user_channel_id; - public number reason; - ChannelClosed(Uint8Array channel_id, number user_channel_id, number reason) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; } - } - export class DiscardFunding extends LDKEvent { - public Uint8Array channel_id; - public Uint8Array transaction; - DiscardFunding(Uint8Array channel_id, Uint8Array transaction) { this.channel_id = channel_id; this.transaction = transaction; } - } - static native void init(); - } - static { LDKEvent.init(); } - public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); - public static native long LDKCVec_EventZ_new(number[] elems); // uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple); export function C2Tuple_u32TxOutZ_get_a(tuple: number): number { if(!isWasmInitialized) { @@ -1433,7 +1390,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_u32TxOutZ_get_b(tuple); return nativeResponseValue; } - public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(number[] elems); // struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple); export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(tuple: number): Uint8Array { if(!isWasmInitialized) { @@ -1450,7 +1406,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(tuple); return nativeResponseValue; } - public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(number[] elems); public static class LDKBalance { private LDKBalance() {} export class ClaimableOnChannelClose extends LDKBalance { @@ -1476,11 +1431,8 @@ public static native long new_empty_slice_vec(); } static { LDKBalance.init(); } public static native LDKBalance LDKBalance_ref_from_ptr(long ptr); - public static native long LDKCVec_BalanceZ_new(number[] elems); - public static native boolean LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NoneLightningErrorZ_result_ok(long arg); public static native void LDKCResult_NoneLightningErrorZ_get_ok(long arg); public static native number LDKCResult_NoneLightningErrorZ_get_err(long arg); // struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple); @@ -1499,8 +1451,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_PublicKeyTypeZ_get_b(tuple); return nativeResponseValue; } - public static native long LDKCVec_C2Tuple_PublicKeyTypeZZ_new(number[] elems); - public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg); public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg); public static native number LDKCResult_boolLightningErrorZ_get_err(long arg); // struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple); @@ -1527,20 +1477,16 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(tuple); return nativeResponseValue; } - public static native long LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(number[] elems); - public static native long LDKCVec_NodeAnnouncementZ_new(number[] elems); - public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg); public static native Uint8Array LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(long arg); public static native number LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg); public static native void LDKCResult_NonePeerHandleErrorZ_get_ok(long arg); public static native number LDKCResult_NonePeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg); public static native boolean LDKCResult_boolPeerHandleErrorZ_get_ok(long arg); public static native number LDKCResult_boolPeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeIdDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NodeIdDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NodeIdDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_err(long arg); @@ -1578,23 +1524,16 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_AccessZ.init(); } public static native LDKCOption_AccessZ LDKCOption_AccessZ_ref_from_ptr(long ptr); - public static native boolean LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelInfoDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelInfoDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelInfoDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RoutingFeesDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_RoutingFeesDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_RoutingFeesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_u64Z_new(number[] elems); - public static native boolean LDKCResult_NodeInfoDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NodeInfoDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NodeInfoDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NetworkGraphDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NetworkGraphDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NetworkGraphDecodeErrorZ_get_err(long arg); public static class LDKCOption_CVec_NetAddressZZ { @@ -1610,107 +1549,70 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_CVec_NetAddressZZ.init(); } public static native LDKCOption_CVec_NetAddressZZ LDKCOption_CVec_NetAddressZZ_ref_from_ptr(long ptr); - public static native boolean LDKCResult_NetAddressDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NetAddressDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NetAddressDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_UpdateAddHTLCZ_new(number[] elems); - public static native long LDKCVec_UpdateFulfillHTLCZ_new(number[] elems); - public static native long LDKCVec_UpdateFailHTLCZ_new(number[] elems); - public static native long LDKCVec_UpdateFailMalformedHTLCZ_new(number[] elems); - public static native boolean LDKCResult_AcceptChannelDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_AcceptChannelDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_AcceptChannelDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelReestablishDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ClosingSignedDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ClosingSignedDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ClosingSignedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_CommitmentSignedDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_CommitmentSignedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_FundingCreatedDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_FundingCreatedDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_FundingCreatedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_FundingSignedDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_FundingSignedDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_FundingSignedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_FundingLockedDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_FundingLockedDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_FundingLockedDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_InitDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_InitDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_InitDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_OpenChannelDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_OpenChannelDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_OpenChannelDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_RevokeAndACKDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_RevokeAndACKDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ShutdownDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ShutdownDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ShutdownDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_UpdateFailHTLCDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_UpdateFailHTLCDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateFeeDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_UpdateFeeDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_UpdateFeeDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_UpdateAddHTLCDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_UpdateAddHTLCDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_PingDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_PingDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_PingDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_PongDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_PongDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_PongDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelAnnouncementDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelAnnouncementDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ChannelUpdateDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ChannelUpdateDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ErrorMessageDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ErrorMessageDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ErrorMessageDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NodeAnnouncementDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NodeAnnouncementDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(long arg); public static class LDKSignOrCreationError { @@ -1726,7 +1628,6 @@ public static native long new_empty_slice_vec(); } static { LDKSignOrCreationError.init(); } public static native LDKSignOrCreationError LDKSignOrCreationError_ref_from_ptr(long ptr); - public static native boolean LDKCResult_InvoiceSignOrCreationErrorZ_result_ok(long arg); public static native number LDKCResult_InvoiceSignOrCreationErrorZ_get_ok(long arg); public static native number LDKCResult_InvoiceSignOrCreationErrorZ_get_err(long arg); @@ -1775,10 +1676,8 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_FilterZ.init(); } public static native LDKCOption_FilterZ LDKCOption_FilterZ_ref_from_ptr(long ptr); - public static native boolean LDKCResult_LockedChannelMonitorNoneZ_result_ok(long arg); public static native number LDKCResult_LockedChannelMonitorNoneZ_get_ok(long arg); public static native void LDKCResult_LockedChannelMonitorNoneZ_get_err(long arg); - public static native long LDKCVec_OutPointZ_new(number[] elems); @@ -2568,6 +2467,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.TxOut_free(_res); // debug statements here } + // uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg); + export function TxOut_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TxOut_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig); export function TxOut_clone(orig: number): number { if(!isWasmInitialized) { @@ -2600,6 +2507,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SecretKeyErrorZ_err(e); return nativeResponseValue; } + // bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o); + export function CResult_SecretKeyErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SecretKeyErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res); export function CResult_SecretKeyErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2624,6 +2539,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PublicKeyErrorZ_err(e); return nativeResponseValue; } + // bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o); + export function CResult_PublicKeyErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PublicKeyErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); export function CResult_PublicKeyErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2632,6 +2555,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PublicKeyErrorZ_free(_res); // debug statements here } + // uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg); + export function CResult_PublicKeyErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PublicKeyErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig); export function CResult_PublicKeyErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2656,14 +2587,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TxCreationKeysDecodeErrorZ_err(e); return nativeResponseValue; } - // void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res); - export function CResult_TxCreationKeysDecodeErrorZ_free(_res: number): void { + // bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o); + export function CResult_TxCreationKeysDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_TxCreationKeysDecodeErrorZ_free(_res); + const nativeResponseValue = wasm.CResult_TxCreationKeysDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res); + export function CResult_TxCreationKeysDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TxCreationKeysDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg); + export function CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig); export function CResult_TxCreationKeysDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2688,6 +2635,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelPublicKeysDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res); export function CResult_ChannelPublicKeysDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2696,6 +2651,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelPublicKeysDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig); export function CResult_ChannelPublicKeysDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2720,6 +2683,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TxCreationKeysErrorZ_err(e); return nativeResponseValue; } + // bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o); + export function CResult_TxCreationKeysErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TxCreationKeysErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res); export function CResult_TxCreationKeysErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2728,6 +2699,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TxCreationKeysErrorZ_free(_res); // debug statements here } + // uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg); + export function CResult_TxCreationKeysErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TxCreationKeysErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig); export function CResult_TxCreationKeysErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2760,6 +2739,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_u32Z_free(_res); // debug statements here } + // uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg); + export function COption_u32Z_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u32Z_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig); export function COption_u32Z_clone(orig: number): number { if(!isWasmInitialized) { @@ -2784,6 +2771,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o); + export function CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res); export function CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2792,6 +2787,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg); + export function CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig); export function CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2816,6 +2819,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); + export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res); export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2824,6 +2835,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); + export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2848,6 +2867,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelTransactionParametersDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res); export function CResult_ChannelTransactionParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2856,6 +2883,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelTransactionParametersDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); export function CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2888,6 +2923,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + export function CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res); export function CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2896,6 +2939,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + export function CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); export function CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2920,6 +2971,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + export function CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res); export function CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2928,6 +2987,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + export function CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); export function CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -2952,6 +3019,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TrustedClosingTransactionNoneZ_err(); return nativeResponseValue; } + // bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o); + export function CResult_TrustedClosingTransactionNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TrustedClosingTransactionNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res); export function CResult_TrustedClosingTransactionNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2976,6 +3051,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CommitmentTransactionDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o); + export function CResult_CommitmentTransactionDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CommitmentTransactionDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res); export function CResult_CommitmentTransactionDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -2984,6 +3067,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CommitmentTransactionDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); + export function CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); export function CResult_CommitmentTransactionDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3008,6 +3099,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TrustedCommitmentTransactionNoneZ_err(); return nativeResponseValue; } + // bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o); + export function CResult_TrustedCommitmentTransactionNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TrustedCommitmentTransactionNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); export function CResult_TrustedCommitmentTransactionNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3032,6 +3131,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_SignatureZNoneZ_err(); return nativeResponseValue; } + // bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o); + export function CResult_CVec_SignatureZNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_SignatureZNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); export function CResult_CVec_SignatureZNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3040,6 +3147,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_SignatureZNoneZ_free(_res); // debug statements here } + // uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg); + export function CResult_CVec_SignatureZNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_SignatureZNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig); export function CResult_CVec_SignatureZNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3064,6 +3179,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ShutdownScriptDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o); + export function CResult_ShutdownScriptDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res); export function CResult_ShutdownScriptDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3072,6 +3195,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ShutdownScriptDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig); export function CResult_ShutdownScriptDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3096,6 +3227,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e); return nativeResponseValue; } + // bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o); + export function CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res); export function CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3104,6 +3243,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res); // debug statements here } + // uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg); + export function CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig); export function CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3128,6 +3275,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o); + export function CResult_NoneErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res); export function CResult_NoneErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3136,6 +3291,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg); + export function CResult_NoneErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig); export function CResult_NoneErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3160,6 +3323,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteHopDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o); + export function CResult_RouteHopDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHopDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res); export function CResult_RouteHopDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3168,6 +3339,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteHopDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg); + export function CResult_RouteHopDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHopDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig); export function CResult_RouteHopDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3208,6 +3387,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o); + export function CResult_RouteDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); export function CResult_RouteDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3216,6 +3403,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg); + export function CResult_RouteDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig); export function CResult_RouteDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3240,6 +3435,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o); + export function CResult_RouteParametersDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res); export function CResult_RouteParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3248,6 +3451,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg); + export function CResult_RouteParametersDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig); export function CResult_RouteParametersDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3288,6 +3499,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_u64Z_free(_res); // debug statements here } + // uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg); + export function COption_u64Z_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u64Z_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); export function COption_u64Z_clone(orig: number): number { if(!isWasmInitialized) { @@ -3312,6 +3531,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_PayeeDecodeErrorZ_is_ok(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR o); + export function CResult_PayeeDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PayeeDecodeErrorZ_free(struct LDKCResult_PayeeDecodeErrorZ _res); export function CResult_PayeeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3320,6 +3547,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg); + export function CResult_PayeeDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_clone(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR orig); export function CResult_PayeeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3352,6 +3587,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o); + export function CResult_RouteHintDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res); export function CResult_RouteHintDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3360,6 +3603,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg); + export function CResult_RouteHintDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig); export function CResult_RouteHintDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3384,6 +3635,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o); + export function CResult_RouteHintHopDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res); export function CResult_RouteHintHopDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3392,6 +3651,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg); + export function CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig); export function CResult_RouteHintHopDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3424,6 +3691,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteLightningErrorZ_err(e); return nativeResponseValue; } + // bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o); + export function CResult_RouteLightningErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteLightningErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); export function CResult_RouteLightningErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3432,6 +3707,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteLightningErrorZ_free(_res); // debug statements here } + // uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg); + export function CResult_RouteLightningErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteLightningErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); export function CResult_RouteLightningErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3456,6 +3739,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TxOutAccessErrorZ_err(e); return nativeResponseValue; } + // bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o); + export function CResult_TxOutAccessErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TxOutAccessErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); export function CResult_TxOutAccessErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3464,6 +3755,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TxOutAccessErrorZ_free(_res); // debug statements here } + // uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg); + export function CResult_TxOutAccessErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TxOutAccessErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); export function CResult_TxOutAccessErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3472,6 +3771,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TxOutAccessErrorZ_clone(orig); return nativeResponseValue; } + // uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg); + export function C2Tuple_usizeTransactionZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_usizeTransactionZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig); export function C2Tuple_usizeTransactionZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3528,6 +3835,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneChannelMonitorUpdateErrZ_err(e); return nativeResponseValue; } + // bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o); + export function CResult_NoneChannelMonitorUpdateErrZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneChannelMonitorUpdateErrZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res); export function CResult_NoneChannelMonitorUpdateErrZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3536,6 +3851,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneChannelMonitorUpdateErrZ_free(_res); // debug statements here } + // uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg); + export function CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig); export function CResult_NoneChannelMonitorUpdateErrZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3576,6 +3899,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_C2Tuple_usizeTransactionZZ_free(_res); // debug statements here } + // uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg); + export function COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig); export function COption_C2Tuple_usizeTransactionZZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3584,12 +3915,100 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_C2Tuple_usizeTransactionZZ_clone(orig); return nativeResponseValue; } - // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); - export function COption_NetworkUpdateZ_some(o: number): number { + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o); + export function COption_ClosureReasonZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.COption_NetworkUpdateZ_some(o); + const nativeResponseValue = wasm.COption_ClosureReasonZ_some(o); + return nativeResponseValue; + } + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void); + export function COption_ClosureReasonZ_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_ClosureReasonZ_none(); + return nativeResponseValue; + } + // void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res); + export function COption_ClosureReasonZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_ClosureReasonZ_free(_res); + // debug statements here + } + // uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg); + export function COption_ClosureReasonZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_ClosureReasonZ_clone_ptr(arg); + return nativeResponseValue; + } + // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig); + export function COption_ClosureReasonZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_ClosureReasonZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o); + export function CResult_COption_ClosureReasonZDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_ClosureReasonZDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_COption_ClosureReasonZDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_ClosureReasonZDecodeErrorZ_err(e); + return nativeResponseValue; + } + // bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o); + export function CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res); + export function CResult_COption_ClosureReasonZDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_ClosureReasonZDecodeErrorZ_free(_res); + // debug statements here + } + // uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg); + export function CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig); + export function CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); + export function COption_NetworkUpdateZ_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_NetworkUpdateZ_some(o); return nativeResponseValue; } // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void); @@ -3608,6 +4027,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_NetworkUpdateZ_free(_res); // debug statements here } + // uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg); + export function COption_NetworkUpdateZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_NetworkUpdateZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig); export function COption_NetworkUpdateZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3624,6 +4051,94 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CVec_SpendableOutputDescriptorZ_free(_res); // debug statements here } + // struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o); + export function COption_EventZ_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_EventZ_some(o); + return nativeResponseValue; + } + // struct LDKCOption_EventZ COption_EventZ_none(void); + export function COption_EventZ_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_EventZ_none(); + return nativeResponseValue; + } + // void COption_EventZ_free(struct LDKCOption_EventZ _res); + export function COption_EventZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_EventZ_free(_res); + // debug statements here + } + // uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg); + export function COption_EventZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_EventZ_clone_ptr(arg); + return nativeResponseValue; + } + // struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig); + export function COption_EventZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_EventZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o); + export function CResult_COption_EventZDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_EventZDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_COption_EventZDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_EventZDecodeErrorZ_err(e); + return nativeResponseValue; + } + // bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o); + export function CResult_COption_EventZDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_EventZDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res); + export function CResult_COption_EventZDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_EventZDecodeErrorZ_free(_res); + // debug statements here + } + // uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg); + export function CResult_COption_EventZDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_EventZDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } + // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig); + export function CResult_COption_EventZDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_EventZDecodeErrorZ_clone(orig); + return nativeResponseValue; + } // void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); export function CVec_MessageSendEventZ_free(_res: number[]): void { if(!isWasmInitialized) { @@ -3648,6 +4163,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o); + export function CResult_InitFeaturesDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res); export function CResult_InitFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3672,6 +4195,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o); + export function CResult_NodeFeaturesDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res); export function CResult_NodeFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3696,6 +4227,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelFeaturesDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelFeaturesDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelFeaturesDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res); export function CResult_ChannelFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3720,6 +4259,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); + export function CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res); export function CResult_InvoiceFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3744,6 +4291,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o); + export function CResult_ScoringParametersDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res); export function CResult_ScoringParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3768,6 +4323,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o); + export function CResult_ScorerDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res); export function CResult_ScorerDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3792,6 +4355,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res); export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3800,6 +4371,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3824,6 +4403,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res); export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3832,6 +4419,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3856,6 +4451,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o); + export function CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res); export function CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3864,6 +4467,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); + export function CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); export function CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3888,6 +4499,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneNoneZ_err(); return nativeResponseValue; } + // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); + export function CResult_NoneNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); export function CResult_NoneNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3896,6 +4515,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneNoneZ_free(_res); // debug statements here } + // uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); + export function CResult_NoneNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); export function CResult_NoneNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3904,6 +4531,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneNoneZ_clone(orig); return nativeResponseValue; } + // uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg); + export function C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig); export function C2Tuple_SignatureCVec_SignatureZZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3944,6 +4579,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); return nativeResponseValue; } + // bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o); + export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res); export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3952,6 +4595,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res); // debug statements here } + // uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg); + export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig); export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3976,6 +4627,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SignatureNoneZ_err(); return nativeResponseValue; } + // bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o); + export function CResult_SignatureNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SignatureNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res); export function CResult_SignatureNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -3984,6 +4643,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SignatureNoneZ_free(_res); // debug statements here } + // uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg); + export function CResult_SignatureNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SignatureNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig); export function CResult_SignatureNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4008,6 +4675,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SignDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o); + export function CResult_SignDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SignDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res); export function CResult_SignDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4016,6 +4691,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SignDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg); + export function CResult_SignDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SignDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig); export function CResult_SignDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4048,6 +4731,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RecoverableSignatureNoneZ_err(); return nativeResponseValue; } + // bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o); + export function CResult_RecoverableSignatureNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RecoverableSignatureNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res); export function CResult_RecoverableSignatureNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4056,6 +4747,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RecoverableSignatureNoneZ_free(_res); // debug statements here } + // uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg); + export function CResult_RecoverableSignatureNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RecoverableSignatureNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig); export function CResult_RecoverableSignatureNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4088,6 +4787,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_CVec_u8ZZNoneZ_err(); return nativeResponseValue; } + // bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o); + export function CResult_CVec_CVec_u8ZZNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_CVec_u8ZZNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res); export function CResult_CVec_CVec_u8ZZNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4096,6 +4803,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_CVec_u8ZZNoneZ_free(_res); // debug statements here } + // uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg); + export function CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig); export function CResult_CVec_CVec_u8ZZNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4120,6 +4835,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InMemorySignerDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o); + export function CResult_InMemorySignerDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InMemorySignerDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res); export function CResult_InMemorySignerDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4128,6 +4851,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InMemorySignerDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg); + export function CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig); export function CResult_InMemorySignerDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4160,14 +4891,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TransactionNoneZ_err(); return nativeResponseValue; } - // void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res); - export function CResult_TransactionNoneZ_free(_res: number): void { + // bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o); + export function CResult_TransactionNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_TransactionNoneZ_free(_res); + const nativeResponseValue = wasm.CResult_TransactionNoneZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res); + export function CResult_TransactionNoneZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TransactionNoneZ_free(_res); // debug statements here } + // uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg); + export function CResult_TransactionNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TransactionNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig); export function CResult_TransactionNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4176,6 +4923,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TransactionNoneZ_clone(orig); return nativeResponseValue; } + // uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg); + export function C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_clone(const struct LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR orig); export function C2Tuple_BlockHashChannelMonitorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4224,6 +4979,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e); return nativeResponseValue; } + // bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o); + export function CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res); export function CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4232,6 +4995,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res); // debug statements here } + // uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg); + export function CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR orig); export function CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4264,6 +5035,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_u16Z_free(_res); // debug statements here } + // uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg); + export function COption_u16Z_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_u16Z_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig); export function COption_u16Z_clone(orig: number): number { if(!isWasmInitialized) { @@ -4288,6 +5067,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneAPIErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o); + export function CResult_NoneAPIErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneAPIErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); export function CResult_NoneAPIErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4296,6 +5083,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneAPIErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg); + export function CResult_NoneAPIErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneAPIErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); export function CResult_NoneAPIErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4336,6 +5131,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult__u832APIErrorZ_err(e); return nativeResponseValue; } + // bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o); + export function CResult__u832APIErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult__u832APIErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res); export function CResult__u832APIErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4344,6 +5147,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult__u832APIErrorZ_free(_res); // debug statements here } + // uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg); + export function CResult__u832APIErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult__u832APIErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig); export function CResult__u832APIErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4368,6 +5179,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_err(e); return nativeResponseValue; } + // bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o); + export function CResult_PaymentIdPaymentSendFailureZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res); export function CResult_PaymentIdPaymentSendFailureZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4376,6 +5195,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_free(_res); // debug statements here } + // uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg); + export function CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig); export function CResult_PaymentIdPaymentSendFailureZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4400,6 +5227,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NonePaymentSendFailureZ_err(e); return nativeResponseValue; } + // bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o); + export function CResult_NonePaymentSendFailureZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NonePaymentSendFailureZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res); export function CResult_NonePaymentSendFailureZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4408,6 +5243,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NonePaymentSendFailureZ_free(_res); // debug statements here } + // uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg); + export function CResult_NonePaymentSendFailureZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NonePaymentSendFailureZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig); export function CResult_NonePaymentSendFailureZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4416,6 +5259,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NonePaymentSendFailureZ_clone(orig); return nativeResponseValue; } + // uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg); + export function C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig); export function C2Tuple_PaymentHashPaymentIdZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4456,6 +5307,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e); return nativeResponseValue; } + // bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o); + export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o); + return nativeResponseValue; + } // void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res); export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4464,6 +5323,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res); // debug statements here } + // uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg); + export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig); export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4480,6 +5347,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CVec_NetAddressZ_free(_res); // debug statements here } + // uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg); + export function C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig); export function C2Tuple_PaymentHashPaymentSecretZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4520,6 +5395,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PaymentSecretAPIErrorZ_err(e); return nativeResponseValue; } + // bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o); + export function CResult_PaymentSecretAPIErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentSecretAPIErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res); export function CResult_PaymentSecretAPIErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4528,6 +5411,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PaymentSecretAPIErrorZ_free(_res); // debug statements here } + // uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg); + export function CResult_PaymentSecretAPIErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentSecretAPIErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig); export function CResult_PaymentSecretAPIErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4576,6 +5467,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o); + export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4600,6 +5499,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelConfigDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelConfigDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelConfigDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res); export function CResult_ChannelConfigDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4608,6 +5515,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelConfigDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); export function CResult_ChannelConfigDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4632,6 +5547,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_OutPointDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o); + export function CResult_OutPointDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_OutPointDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res); export function CResult_OutPointDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4640,6 +5563,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_OutPointDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg); + export function CResult_OutPointDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_OutPointDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig); export function CResult_OutPointDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4672,6 +5603,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_TypeZ_free(_res); // debug statements here } + // uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg); + export function COption_TypeZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_TypeZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig); export function COption_TypeZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4696,6 +5635,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o); + export function CResult_COption_TypeZDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res); export function CResult_COption_TypeZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4704,6 +5651,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg); + export function CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig); export function CResult_COption_TypeZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4728,6 +5683,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_err(e); return nativeResponseValue; } + // bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o); + export function CResult_PaymentIdPaymentErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res); export function CResult_PaymentIdPaymentErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4736,6 +5699,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_free(_res); // debug statements here } + // uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg); + export function CResult_PaymentIdPaymentErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig); export function CResult_PaymentIdPaymentErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4760,6 +5731,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SiPrefixNoneZ_err(); return nativeResponseValue; } + // bool CResult_SiPrefixNoneZ_is_ok(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR o); + export function CResult_SiPrefixNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SiPrefixNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res); export function CResult_SiPrefixNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4768,6 +5747,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SiPrefixNoneZ_free(_res); // debug statements here } + // uint64_t CResult_SiPrefixNoneZ_clone_ptr(LDKCResult_SiPrefixNoneZ *NONNULL_PTR arg); + export function CResult_SiPrefixNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SiPrefixNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig); export function CResult_SiPrefixNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4792,6 +5779,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceNoneZ_err(); return nativeResponseValue; } + // bool CResult_InvoiceNoneZ_is_ok(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR o); + export function CResult_InvoiceNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InvoiceNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res); export function CResult_InvoiceNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4800,6 +5795,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceNoneZ_free(_res); // debug statements here } + // uint64_t CResult_InvoiceNoneZ_clone_ptr(LDKCResult_InvoiceNoneZ *NONNULL_PTR arg); + export function CResult_InvoiceNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InvoiceNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig); export function CResult_InvoiceNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4824,6 +5827,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SignedRawInvoiceNoneZ_err(); return nativeResponseValue; } + // bool CResult_SignedRawInvoiceNoneZ_is_ok(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR o); + export function CResult_SignedRawInvoiceNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SignedRawInvoiceNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res); export function CResult_SignedRawInvoiceNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4832,6 +5843,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SignedRawInvoiceNoneZ_free(_res); // debug statements here } + // uint64_t CResult_SignedRawInvoiceNoneZ_clone_ptr(LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR arg); + export function CResult_SignedRawInvoiceNoneZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_SignedRawInvoiceNoneZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig); export function CResult_SignedRawInvoiceNoneZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4840,6 +5859,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SignedRawInvoiceNoneZ_clone(orig); return nativeResponseValue; } + // uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg); + export function C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig); export function C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4880,6 +5907,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PayeePubKeyErrorZ_err(e); return nativeResponseValue; } + // bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o); + export function CResult_PayeePubKeyErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PayeePubKeyErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res); export function CResult_PayeePubKeyErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4888,6 +5923,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PayeePubKeyErrorZ_free(_res); // debug statements here } + // uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg); + export function CResult_PayeePubKeyErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PayeePubKeyErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig); export function CResult_PayeePubKeyErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4920,6 +5963,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PositiveTimestampCreationErrorZ_err(e); return nativeResponseValue; } + // bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o); + export function CResult_PositiveTimestampCreationErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PositiveTimestampCreationErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res); export function CResult_PositiveTimestampCreationErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4928,6 +5979,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PositiveTimestampCreationErrorZ_free(_res); // debug statements here } + // uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg); + export function CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig); export function CResult_PositiveTimestampCreationErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4952,6 +6011,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneSemanticErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o); + export function CResult_NoneSemanticErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneSemanticErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res); export function CResult_NoneSemanticErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4960,6 +6027,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneSemanticErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg); + export function CResult_NoneSemanticErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneSemanticErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig); export function CResult_NoneSemanticErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -4984,6 +6059,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceSemanticErrorZ_err(e); return nativeResponseValue; } + // bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o); + export function CResult_InvoiceSemanticErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InvoiceSemanticErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res); export function CResult_InvoiceSemanticErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -4992,6 +6075,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceSemanticErrorZ_free(_res); // debug statements here } + // uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg); + export function CResult_InvoiceSemanticErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InvoiceSemanticErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig); export function CResult_InvoiceSemanticErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5016,6 +6107,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_DescriptionCreationErrorZ_err(e); return nativeResponseValue; } + // bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o); + export function CResult_DescriptionCreationErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DescriptionCreationErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res); export function CResult_DescriptionCreationErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5024,6 +6123,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_DescriptionCreationErrorZ_free(_res); // debug statements here } + // uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg); + export function CResult_DescriptionCreationErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DescriptionCreationErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig); export function CResult_DescriptionCreationErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5048,108 +6155,252 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ExpiryTimeCreationErrorZ_err(e); return nativeResponseValue; } - // void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res); - export function CResult_ExpiryTimeCreationErrorZ_free(_res: number): void { + // bool CResult_ExpiryTimeCreationErrorZ_is_ok(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR o); + export function CResult_ExpiryTimeCreationErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ExpiryTimeCreationErrorZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res); + export function CResult_ExpiryTimeCreationErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ExpiryTimeCreationErrorZ_free(_res); + // debug statements here + } + // uint64_t CResult_ExpiryTimeCreationErrorZ_clone_ptr(LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR arg); + export function CResult_ExpiryTimeCreationErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ExpiryTimeCreationErrorZ_clone_ptr(arg); + return nativeResponseValue; + } + // struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig); + export function CResult_ExpiryTimeCreationErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ExpiryTimeCreationErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o); + export function CResult_PrivateRouteCreationErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e); + export function CResult_PrivateRouteCreationErrorZ_err(e: CreationError): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_err(e); + return nativeResponseValue; + } + // bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o); + export function CResult_PrivateRouteCreationErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res); + export function CResult_PrivateRouteCreationErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_free(_res); + // debug statements here + } + // uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg); + export function CResult_PrivateRouteCreationErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_clone_ptr(arg); + return nativeResponseValue; + } + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig); + export function CResult_PrivateRouteCreationErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o); + export function CResult_StringErrorZ_ok(o: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_StringErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e); + export function CResult_StringErrorZ_err(e: Secp256k1Error): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_StringErrorZ_err(e); + return nativeResponseValue; + } + // bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o); + export function CResult_StringErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_StringErrorZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res); + export function CResult_StringErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_StringErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); + export function CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_ChannelMonitorUpdateDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e); + return nativeResponseValue; + } + // bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res); + export function CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res); + // debug statements here + } + // uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_ExpiryTimeCreationErrorZ_free(_res); - // debug statements here + const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; } - // struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig); - export function CResult_ExpiryTimeCreationErrorZ_clone(orig: number): number { + // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig); + export function CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_ExpiryTimeCreationErrorZ_clone(orig); + const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig); return nativeResponseValue; } - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o); - export function CResult_PrivateRouteCreationErrorZ_ok(o: number): number { + // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o); + export function COption_MonitorEventZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_ok(o); + const nativeResponseValue = wasm.COption_MonitorEventZ_some(o); return nativeResponseValue; } - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e); - export function CResult_PrivateRouteCreationErrorZ_err(e: CreationError): number { + // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void); + export function COption_MonitorEventZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_err(e); + const nativeResponseValue = wasm.COption_MonitorEventZ_none(); return nativeResponseValue; } - // void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res); - export function CResult_PrivateRouteCreationErrorZ_free(_res: number): void { + // void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res); + export function COption_MonitorEventZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_free(_res); + const nativeResponseValue = wasm.COption_MonitorEventZ_free(_res); // debug statements here } - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig); - export function CResult_PrivateRouteCreationErrorZ_clone(orig: number): number { + // uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg); + export function COption_MonitorEventZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_PrivateRouteCreationErrorZ_clone(orig); + const nativeResponseValue = wasm.COption_MonitorEventZ_clone_ptr(arg); return nativeResponseValue; } - // struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o); - export function CResult_StringErrorZ_ok(o: String): number { + // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig); + export function COption_MonitorEventZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_StringErrorZ_ok(o); + const nativeResponseValue = wasm.COption_MonitorEventZ_clone(orig); return nativeResponseValue; } - // struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e); - export function CResult_StringErrorZ_err(e: Secp256k1Error): number { + // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o); + export function CResult_COption_MonitorEventZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_StringErrorZ_err(e); + const nativeResponseValue = wasm.CResult_COption_MonitorEventZDecodeErrorZ_ok(o); return nativeResponseValue; } - // void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res); - export function CResult_StringErrorZ_free(_res: number): void { + // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_COption_MonitorEventZDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_StringErrorZ_free(_res); - // debug statements here + const nativeResponseValue = wasm.CResult_COption_MonitorEventZDecodeErrorZ_err(e); + return nativeResponseValue; } - // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); - export function CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o: number): number { + // bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o); + export function CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o); + const nativeResponseValue = wasm.CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o); return nativeResponseValue; } - // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e); - export function CResult_ChannelMonitorUpdateDecodeErrorZ_err(e: number): number { + // void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res); + export function CResult_COption_MonitorEventZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e); - return nativeResponseValue; + const nativeResponseValue = wasm.CResult_COption_MonitorEventZDecodeErrorZ_free(_res); + // debug statements here } - // void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res); - export function CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: number): void { + // uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg); + export function CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res); - // debug statements here + const nativeResponseValue = wasm.CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; } - // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig); - export function CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: number): number { + // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig); + export function CResult_COption_MonitorEventZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig); + const nativeResponseValue = wasm.CResult_COption_MonitorEventZDecodeErrorZ_clone(orig); return nativeResponseValue; } // struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o); @@ -5168,6 +6419,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_HTLCUpdateDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o); + export function CResult_HTLCUpdateDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_HTLCUpdateDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res); export function CResult_HTLCUpdateDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5176,6 +6435,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_HTLCUpdateDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg); + export function CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig); export function CResult_HTLCUpdateDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5200,6 +6467,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NoneMonitorUpdateErrorZ_is_ok(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR o); + export function CResult_NoneMonitorUpdateErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res); export function CResult_NoneMonitorUpdateErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5208,6 +6483,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg); + export function CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig); export function CResult_NoneMonitorUpdateErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5216,6 +6499,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_clone(orig); return nativeResponseValue; } + // uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg); + export function C2Tuple_OutPointScriptZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_OutPointScriptZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig); export function C2Tuple_OutPointScriptZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5240,6 +6531,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.C2Tuple_OutPointScriptZ_free(_res); // debug statements here } + // uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg); + export function C2Tuple_u32ScriptZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32ScriptZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig); export function C2Tuple_u32ScriptZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5272,6 +6571,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CVec_C2Tuple_u32ScriptZZ_free(_res); // debug statements here } + // uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg); + export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig); export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5320,6 +6627,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CVec_TransactionZ_free(_res); // debug statements here } + // uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg); + export function C2Tuple_u32TxOutZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32TxOutZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig); export function C2Tuple_u32TxOutZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5352,6 +6667,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CVec_C2Tuple_u32TxOutZZ_free(_res); // debug statements here } + // uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg); + export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig); export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5408,6 +6731,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o); + export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res); export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5416,6 +6747,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg); + export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR orig); export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5440,6 +6779,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o); + export function CResult_NoneLightningErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); export function CResult_NoneLightningErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5448,6 +6795,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg); + export function CResult_NoneLightningErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); export function CResult_NoneLightningErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5456,6 +6811,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_clone(orig); return nativeResponseValue; } + // uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg); + export function C2Tuple_PublicKeyTypeZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PublicKeyTypeZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig); export function C2Tuple_PublicKeyTypeZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5504,6 +6867,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_boolLightningErrorZ_err(e); return nativeResponseValue; } + // bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o); + export function CResult_boolLightningErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_boolLightningErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); export function CResult_boolLightningErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5512,6 +6883,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_boolLightningErrorZ_free(_res); // debug statements here } + // uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg); + export function CResult_boolLightningErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_boolLightningErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); export function CResult_boolLightningErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5520,6 +6899,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_boolLightningErrorZ_clone(orig); return nativeResponseValue; } + // uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg); + export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5584,6 +6971,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_u8ZPeerHandleErrorZ_err(e); return nativeResponseValue; } + // bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o); + export function CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res); export function CResult_CVec_u8ZPeerHandleErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5592,6 +6987,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_u8ZPeerHandleErrorZ_free(_res); // debug statements here } + // uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg); + export function CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig); export function CResult_CVec_u8ZPeerHandleErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5616,6 +7019,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NonePeerHandleErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o); + export function CResult_NonePeerHandleErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NonePeerHandleErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res); export function CResult_NonePeerHandleErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5624,6 +7035,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NonePeerHandleErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg); + export function CResult_NonePeerHandleErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NonePeerHandleErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig); export function CResult_NonePeerHandleErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5648,6 +7067,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_boolPeerHandleErrorZ_err(e); return nativeResponseValue; } + // bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o); + export function CResult_boolPeerHandleErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_boolPeerHandleErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res); export function CResult_boolPeerHandleErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5656,6 +7083,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_boolPeerHandleErrorZ_free(_res); // debug statements here } + // uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg); + export function CResult_boolPeerHandleErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_boolPeerHandleErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); export function CResult_boolPeerHandleErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5680,6 +7115,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o); + export function CResult_NodeIdDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res); export function CResult_NodeIdDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5688,6 +7131,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg); + export function CResult_NodeIdDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); export function CResult_NodeIdDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5696,6 +7147,54 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o); + export function CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_COption_NetworkUpdateZDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_NetworkUpdateZDecodeErrorZ_err(e); + return nativeResponseValue; + } + // bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o); + export function CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } + // void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res); + export function CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res); + // debug statements here + } + // uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg); + export function CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig); + export function CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig); + return nativeResponseValue; + } // struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o); export function COption_AccessZ_some(o: number): number { if(!isWasmInitialized) { @@ -5736,6 +7235,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_DirectionalChannelInfoDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR o); + export function CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res); export function CResult_DirectionalChannelInfoDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5744,6 +7251,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_DirectionalChannelInfoDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg); + export function CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig); export function CResult_DirectionalChannelInfoDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5768,6 +7283,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelInfoDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelInfoDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelInfoDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res); export function CResult_ChannelInfoDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5776,6 +7299,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelInfoDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig); export function CResult_ChannelInfoDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5800,6 +7331,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RoutingFeesDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o); + export function CResult_RoutingFeesDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RoutingFeesDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); export function CResult_RoutingFeesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5808,6 +7347,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RoutingFeesDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg); + export function CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); export function CResult_RoutingFeesDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5832,6 +7379,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o); + export function CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); export function CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5840,6 +7395,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg); + export function CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); export function CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5872,6 +7435,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeInfoDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o); + export function CResult_NodeInfoDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeInfoDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); export function CResult_NodeInfoDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5880,6 +7451,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeInfoDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg); + export function CResult_NodeInfoDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeInfoDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); export function CResult_NodeInfoDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5904,6 +7483,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NetworkGraphDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o); + export function CResult_NetworkGraphDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NetworkGraphDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); export function CResult_NetworkGraphDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5912,6 +7499,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NetworkGraphDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg); + export function CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig); export function CResult_NetworkGraphDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5944,6 +7539,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_CVec_NetAddressZZ_free(_res); // debug statements here } + // uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg); + export function COption_CVec_NetAddressZZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_CVec_NetAddressZZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig); export function COption_CVec_NetAddressZZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -5968,6 +7571,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o); + export function CResult_NetAddressDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res); export function CResult_NetAddressDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -5976,6 +7587,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg); + export function CResult_NetAddressDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig); export function CResult_NetAddressDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6032,6 +7651,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_AcceptChannelDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o); + export function CResult_AcceptChannelDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_AcceptChannelDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res); export function CResult_AcceptChannelDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6040,6 +7667,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_AcceptChannelDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg); + export function CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig); export function CResult_AcceptChannelDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6064,6 +7699,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_AnnouncementSignaturesDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o); + export function CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res); export function CResult_AnnouncementSignaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6072,6 +7715,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_AnnouncementSignaturesDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg); + export function CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig); export function CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6096,6 +7747,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelReestablishDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelReestablishDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelReestablishDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res); export function CResult_ChannelReestablishDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6104,6 +7763,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelReestablishDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig); export function CResult_ChannelReestablishDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6128,6 +7795,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ClosingSignedDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o); + export function CResult_ClosingSignedDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ClosingSignedDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res); export function CResult_ClosingSignedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6136,6 +7811,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ClosingSignedDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig); export function CResult_ClosingSignedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6160,6 +7843,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o); + export function CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res); export function CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6168,6 +7859,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig); export function CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6192,6 +7891,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CommitmentSignedDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o); + export function CResult_CommitmentSignedDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CommitmentSignedDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res); export function CResult_CommitmentSignedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6200,6 +7907,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CommitmentSignedDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg); + export function CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig); export function CResult_CommitmentSignedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6224,6 +7939,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_FundingCreatedDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o); + export function CResult_FundingCreatedDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_FundingCreatedDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res); export function CResult_FundingCreatedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6232,6 +7955,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_FundingCreatedDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg); + export function CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig); export function CResult_FundingCreatedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6256,6 +7987,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_FundingSignedDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o); + export function CResult_FundingSignedDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_FundingSignedDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res); export function CResult_FundingSignedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6264,6 +8003,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_FundingSignedDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg); + export function CResult_FundingSignedDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_FundingSignedDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig); export function CResult_FundingSignedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6288,6 +8035,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_FundingLockedDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_FundingLockedDecodeErrorZ_is_ok(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR o); + export function CResult_FundingLockedDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_FundingLockedDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res); export function CResult_FundingLockedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6296,6 +8051,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_FundingLockedDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg); + export function CResult_FundingLockedDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_FundingLockedDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig); export function CResult_FundingLockedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6320,6 +8083,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InitDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o); + export function CResult_InitDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InitDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res); export function CResult_InitDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6328,6 +8099,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InitDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg); + export function CResult_InitDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InitDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig); export function CResult_InitDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6352,6 +8131,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_OpenChannelDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o); + export function CResult_OpenChannelDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_OpenChannelDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res); export function CResult_OpenChannelDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6360,6 +8147,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_OpenChannelDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg); + export function CResult_OpenChannelDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_OpenChannelDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig); export function CResult_OpenChannelDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6384,6 +8179,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RevokeAndACKDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o); + export function CResult_RevokeAndACKDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RevokeAndACKDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res); export function CResult_RevokeAndACKDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6392,6 +8195,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RevokeAndACKDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg); + export function CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig); export function CResult_RevokeAndACKDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6416,6 +8227,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ShutdownDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o); + export function CResult_ShutdownDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res); export function CResult_ShutdownDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6424,6 +8243,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ShutdownDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ShutdownDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig); export function CResult_ShutdownDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6448,6 +8275,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateFailHTLCDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o); + export function CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res); export function CResult_UpdateFailHTLCDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6456,6 +8291,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateFailHTLCDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg); + export function CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig); export function CResult_UpdateFailHTLCDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6480,6 +8323,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o); + export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res); export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6488,6 +8339,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg); + export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig); export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6512,6 +8371,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateFeeDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o); + export function CResult_UpdateFeeDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateFeeDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res); export function CResult_UpdateFeeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6520,6 +8387,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateFeeDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg); + export function CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig); export function CResult_UpdateFeeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6544,6 +8419,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o); + export function CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res); export function CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6552,6 +8435,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg); + export function CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig); export function CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6576,6 +8467,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateAddHTLCDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o); + export function CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res); export function CResult_UpdateAddHTLCDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6584,6 +8483,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UpdateAddHTLCDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg); + export function CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig); export function CResult_UpdateAddHTLCDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6608,6 +8515,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PingDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o); + export function CResult_PingDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PingDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res); export function CResult_PingDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6616,6 +8531,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PingDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg); + export function CResult_PingDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PingDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig); export function CResult_PingDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6640,6 +8563,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PongDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o); + export function CResult_PongDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PongDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res); export function CResult_PongDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6648,6 +8579,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_PongDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg); + export function CResult_PongDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PongDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig); export function CResult_PongDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6672,6 +8611,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o); + export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res); export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6680,6 +8627,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg); + export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6704,6 +8659,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelAnnouncementDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res); export function CResult_ChannelAnnouncementDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6712,6 +8675,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelAnnouncementDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); export function CResult_ChannelAnnouncementDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6736,13 +8707,29 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o); + export function CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res); export function CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res); - // debug statements here + const nativeResponseValue = wasm.CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res); + // debug statements here + } + // uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg); + export function CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; } // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig); export function CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig: number): number { @@ -6768,6 +8755,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelUpdateDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o); + export function CResult_ChannelUpdateDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelUpdateDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res); export function CResult_ChannelUpdateDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6776,6 +8771,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ChannelUpdateDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig); export function CResult_ChannelUpdateDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6800,6 +8803,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ErrorMessageDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o); + export function CResult_ErrorMessageDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ErrorMessageDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); export function CResult_ErrorMessageDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6808,6 +8819,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ErrorMessageDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig); export function CResult_ErrorMessageDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6832,6 +8851,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o); + export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6840,6 +8867,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); + export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6864,6 +8899,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeAnnouncementDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o); + export function CResult_NodeAnnouncementDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeAnnouncementDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res); export function CResult_NodeAnnouncementDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6872,6 +8915,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NodeAnnouncementDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); + export function CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); export function CResult_NodeAnnouncementDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6896,6 +8947,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_QueryShortChannelIdsDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o); + export function CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); export function CResult_QueryShortChannelIdsDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6904,6 +8963,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_QueryShortChannelIdsDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg); + export function CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig); export function CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6928,6 +8995,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o); + export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6936,6 +9011,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig); export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6960,6 +9043,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_QueryChannelRangeDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o); + export function CResult_QueryChannelRangeDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_QueryChannelRangeDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); export function CResult_QueryChannelRangeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -6968,6 +9059,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_QueryChannelRangeDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg); + export function CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig); export function CResult_QueryChannelRangeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -6992,6 +9091,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ReplyChannelRangeDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o); + export function CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); export function CResult_ReplyChannelRangeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -7000,6 +9107,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ReplyChannelRangeDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg); + export function CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig); export function CResult_ReplyChannelRangeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -7024,6 +9139,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_GossipTimestampFilterDecodeErrorZ_err(e); return nativeResponseValue; } + // bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o); + export function CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); export function CResult_GossipTimestampFilterDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -7032,6 +9155,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_GossipTimestampFilterDecodeErrorZ_free(_res); // debug statements here } + // uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg); + export function CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); export function CResult_GossipTimestampFilterDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -7056,6 +9187,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceSignOrCreationErrorZ_err(e); return nativeResponseValue; } + // bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o); + export function CResult_InvoiceSignOrCreationErrorZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InvoiceSignOrCreationErrorZ_is_ok(o); + return nativeResponseValue; + } // void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res); export function CResult_InvoiceSignOrCreationErrorZ_free(_res: number): void { if(!isWasmInitialized) { @@ -7064,6 +9203,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceSignOrCreationErrorZ_free(_res); // debug statements here } + // uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg); + export function CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig); export function CResult_InvoiceSignOrCreationErrorZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -7112,6 +9259,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_LockedChannelMonitorNoneZ_err(); return nativeResponseValue; } + // bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o); + export function CResult_LockedChannelMonitorNoneZ_is_ok(o: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_LockedChannelMonitorNoneZ_is_ok(o); + return nativeResponseValue; + } // void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res); export function CResult_LockedChannelMonitorNoneZ_free(_res: number): void { if(!isWasmInitialized) { @@ -7136,6 +9291,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PaymentPurpose_free(this_ptr); // debug statements here } + // uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg); + export function PaymentPurpose_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentPurpose_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig); export function PaymentPurpose_clone(orig: number): number { if(!isWasmInitialized) { @@ -7168,6 +9331,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ClosureReason_free(this_ptr); // debug statements here } + // uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg); + export function ClosureReason_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig); export function ClosureReason_clone(orig: number): number { if(!isWasmInitialized) { @@ -7240,6 +9411,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ClosureReason_write(obj); return decodeArray(nativeResponseValue); } + // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser); + export function ClosureReason_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_read(encodeArray(ser)); + return nativeResponseValue; + } // void Event_free(struct LDKEvent this_ptr); export function Event_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -7248,6 +9427,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Event_free(this_ptr); // debug statements here } + // uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg); + export function Event_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Event_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); export function Event_clone(orig: number): number { if(!isWasmInitialized) { @@ -7336,6 +9523,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Event_write(obj); return decodeArray(nativeResponseValue); } + // struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser); + export function Event_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Event_read(encodeArray(ser)); + return nativeResponseValue; + } // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); export function MessageSendEvent_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -7344,6 +9539,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MessageSendEvent_free(this_ptr); // debug statements here } + // uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg); + export function MessageSendEvent_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MessageSendEvent_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); export function MessageSendEvent_clone(orig: number): number { if(!isWasmInitialized) { @@ -7536,6 +9739,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.APIError_free(this_ptr); // debug statements here } + // uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg); + export function APIError_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig); export function APIError_clone(orig: number): number { if(!isWasmInitialized) { @@ -7688,6 +9899,110 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Level_max(); return nativeResponseValue; } + // void Record_free(struct LDKRecord this_obj); + export function Record_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_free(this_obj); + // debug statements here + } + // enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr); + export function Record_get_level(this_ptr: number): Level { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_get_level(this_ptr); + return nativeResponseValue; + } + // void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val); + export function Record_set_level(this_ptr: number, val: Level): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_set_level(this_ptr, val); + // debug statements here + } + // struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr); + export function Record_get_args(this_ptr: number): String { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_get_args(this_ptr); + return nativeResponseValue; + } + // void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); + export function Record_set_args(this_ptr: number, val: String): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_set_args(this_ptr, val); + // debug statements here + } + // struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr); + export function Record_get_module_path(this_ptr: number): String { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_get_module_path(this_ptr); + return nativeResponseValue; + } + // void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); + export function Record_set_module_path(this_ptr: number, val: String): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_set_module_path(this_ptr, val); + // debug statements here + } + // struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr); + export function Record_get_file(this_ptr: number): String { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_get_file(this_ptr); + return nativeResponseValue; + } + // void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); + export function Record_set_file(this_ptr: number, val: String): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_set_file(this_ptr, val); + // debug statements here + } + // uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr); + export function Record_get_line(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_get_line(this_ptr); + return nativeResponseValue; + } + // void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val); + export function Record_set_line(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_set_line(this_ptr, val); + // debug statements here + } + // uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg); + export function Record_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_clone_ptr(arg); + return nativeResponseValue; + } + // struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig); + export function Record_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Record_clone(orig); + return nativeResponseValue; + } // void Logger_free(struct LDKLogger this_ptr); export function Logger_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -7760,6 +10075,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); return nativeResponseValue; } + // uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg); + export function ChannelHandshakeConfig_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); export function ChannelHandshakeConfig_clone(orig: number): number { if(!isWasmInitialized) { @@ -7920,6 +10243,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); return nativeResponseValue; } + // uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg); + export function ChannelHandshakeLimits_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeLimits_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig); export function ChannelHandshakeLimits_clone(orig: number): number { if(!isWasmInitialized) { @@ -8064,6 +10395,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); return nativeResponseValue; } + // uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg); + export function ChannelConfig_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelConfig_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); export function ChannelConfig_clone(orig: number): number { if(!isWasmInitialized) { @@ -8176,6 +10515,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UserConfig_new(own_channel_config_arg, peer_channel_config_limits_arg, channel_options_arg, accept_forwards_to_priv_channels_arg); return nativeResponseValue; } + // uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg); + export function UserConfig_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UserConfig_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); export function UserConfig_clone(orig: number): number { if(!isWasmInitialized) { @@ -8200,6 +10547,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BestBlock_free(this_obj); // debug statements here } + // uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg); + export function BestBlock_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.BestBlock_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig); export function BestBlock_clone(orig: number): number { if(!isWasmInitialized) { @@ -8392,6 +10747,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.WatchedOutput_new(encodeArray(block_hash_arg), outpoint_arg, encodeArray(script_pubkey_arg)); return nativeResponseValue; } + // uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg); + export function WatchedOutput_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.WatchedOutput_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig); export function WatchedOutput_clone(orig: number): number { if(!isWasmInitialized) { @@ -8472,6 +10835,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MonitorUpdateId_free(this_obj); // debug statements here } + // uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg); + export function MonitorUpdateId_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorUpdateId_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig); export function MonitorUpdateId_clone(orig: number): number { if(!isWasmInitialized) { @@ -8616,6 +10987,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMonitorUpdate_set_update_id(this_ptr, val); // debug statements here } + // uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg); + export function ChannelMonitorUpdate_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdate_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); export function ChannelMonitorUpdate_clone(orig: number): number { if(!isWasmInitialized) { @@ -8672,6 +11051,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MonitorUpdateError_new(a_arg); return nativeResponseValue; } + // uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg); + export function MonitorUpdateError_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorUpdateError_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig); export function MonitorUpdateError_clone(orig: number): number { if(!isWasmInitialized) { @@ -8688,6 +11075,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MonitorEvent_free(this_ptr); // debug statements here } + // uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg); + export function MonitorEvent_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorEvent_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig); export function MonitorEvent_clone(orig: number): number { if(!isWasmInitialized) { @@ -8736,6 +11131,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MonitorEvent_write(obj); return decodeArray(nativeResponseValue); } + // struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser); + export function MonitorEvent_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorEvent_read(encodeArray(ser)); + return nativeResponseValue; + } // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj); export function HTLCUpdate_free(this_obj: number): void { if(!isWasmInitialized) { @@ -8744,6 +11147,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.HTLCUpdate_free(this_obj); // debug statements here } + // uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg); + export function HTLCUpdate_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HTLCUpdate_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig); export function HTLCUpdate_clone(orig: number): number { if(!isWasmInitialized) { @@ -8776,6 +11187,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Balance_free(this_ptr); // debug statements here } + // uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg); + export function Balance_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Balance_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig); export function Balance_clone(orig: number): number { if(!isWasmInitialized) { @@ -8832,6 +11251,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMonitor_free(this_obj); // debug statements here } + // uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg); + export function ChannelMonitor_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitor_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig); export function ChannelMonitor_clone(orig: number): number { if(!isWasmInitialized) { @@ -9032,6 +11459,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.OutPoint_new(encodeArray(txid_arg), index_arg); return nativeResponseValue; } + // uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg); + export function OutPoint_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.OutPoint_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig); export function OutPoint_clone(orig: number): number { if(!isWasmInitialized) { @@ -9200,6 +11635,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_new(outpoint_arg, encodeArray(per_commitment_point_arg), to_self_delay_arg, output_arg, encodeArray(revocation_pubkey_arg), encodeArray(channel_keys_id_arg), channel_value_satoshis_arg); return nativeResponseValue; } + // uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg); + export function DelayedPaymentOutputDescriptor_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig); export function DelayedPaymentOutputDescriptor_clone(orig: number): number { if(!isWasmInitialized) { @@ -9296,6 +11739,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_new(outpoint_arg, output_arg, encodeArray(channel_keys_id_arg), channel_value_satoshis_arg); return nativeResponseValue; } + // uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg); + export function StaticPaymentOutputDescriptor_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig); export function StaticPaymentOutputDescriptor_clone(orig: number): number { if(!isWasmInitialized) { @@ -9328,6 +11779,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SpendableOutputDescriptor_free(this_ptr); // debug statements here } + // uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg); + export function SpendableOutputDescriptor_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SpendableOutputDescriptor_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig); export function SpendableOutputDescriptor_clone(orig: number): number { if(!isWasmInitialized) { @@ -9384,6 +11843,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BaseSign_free(this_ptr); // debug statements here } + // uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg); + export function Sign_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Sign_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig); export function Sign_clone(orig: number): number { if(!isWasmInitialized) { @@ -9512,6 +11979,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InMemorySigner_set_commitment_seed(this_ptr, encodeArray(val)); // debug statements here } + // uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg); + export function InMemorySigner_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InMemorySigner_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig); export function InMemorySigner_clone(orig: number): number { if(!isWasmInitialized) { @@ -9720,6 +12195,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChainParameters_new(network_arg, best_block_arg); return nativeResponseValue; } + // uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg); + export function ChainParameters_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChainParameters_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig); export function ChainParameters_clone(orig: number): number { if(!isWasmInitialized) { @@ -9792,6 +12275,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); return nativeResponseValue; } + // uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg); + export function CounterpartyForwardingInfo_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig); export function CounterpartyForwardingInfo_clone(orig: number): number { if(!isWasmInitialized) { @@ -9880,6 +12371,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelCounterparty_new(encodeArray(node_id_arg), features_arg, unspendable_punishment_reserve_arg, forwarding_info_arg); return nativeResponseValue; } + // uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg); + export function ChannelCounterparty_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelCounterparty_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig); export function ChannelCounterparty_clone(orig: number): number { if(!isWasmInitialized) { @@ -10144,6 +12643,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelDetails_new(encodeArray(channel_id_arg), counterparty_arg, funding_txo_arg, short_channel_id_arg, channel_value_satoshis_arg, unspendable_punishment_reserve_arg, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg, force_close_spend_delay_arg, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); return nativeResponseValue; } + // uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg); + export function ChannelDetails_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelDetails_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); export function ChannelDetails_clone(orig: number): number { if(!isWasmInitialized) { @@ -10160,6 +12667,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PaymentSendFailure_free(this_ptr); // debug statements here } + // uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg); + export function PaymentSendFailure_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentSendFailure_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig); export function PaymentSendFailure_clone(orig: number): number { if(!isWasmInitialized) { @@ -10568,6 +13083,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DecodeError_free(this_obj); // debug statements here } + // uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg); + export function DecodeError_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DecodeError_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig); export function DecodeError_clone(orig: number): number { if(!isWasmInitialized) { @@ -10608,6 +13131,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Init_new(features_arg); return nativeResponseValue; } + // uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg); + export function Init_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Init_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig); export function Init_clone(orig: number): number { if(!isWasmInitialized) { @@ -10664,6 +13195,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ErrorMessage_new(encodeArray(channel_id_arg), data_arg); return nativeResponseValue; } + // uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg); + export function ErrorMessage_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ErrorMessage_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); export function ErrorMessage_clone(orig: number): number { if(!isWasmInitialized) { @@ -10720,6 +13259,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Ping_new(ponglen_arg, byteslen_arg); return nativeResponseValue; } + // uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg); + export function Ping_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Ping_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig); export function Ping_clone(orig: number): number { if(!isWasmInitialized) { @@ -10760,6 +13307,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Pong_new(byteslen_arg); return nativeResponseValue; } + // uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg); + export function Pong_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Pong_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig); export function Pong_clone(orig: number): number { if(!isWasmInitialized) { @@ -11064,6 +13619,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.OpenChannel_set_channel_flags(this_ptr, val); // debug statements here } + // uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg); + export function OpenChannel_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.OpenChannel_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); export function OpenChannel_clone(orig: number): number { if(!isWasmInitialized) { @@ -11304,6 +13867,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.AcceptChannel_set_first_per_commitment_point(this_ptr, encodeArray(val)); // debug statements here } + // uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg); + export function AcceptChannel_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.AcceptChannel_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); export function AcceptChannel_clone(orig: number): number { if(!isWasmInitialized) { @@ -11392,6 +13963,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.FundingCreated_new(encodeArray(temporary_channel_id_arg), encodeArray(funding_txid_arg), funding_output_index_arg, encodeArray(signature_arg)); return nativeResponseValue; } + // uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg); + export function FundingCreated_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.FundingCreated_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); export function FundingCreated_clone(orig: number): number { if(!isWasmInitialized) { @@ -11448,6 +14027,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.FundingSigned_new(encodeArray(channel_id_arg), encodeArray(signature_arg)); return nativeResponseValue; } + // uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg); + export function FundingSigned_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.FundingSigned_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); export function FundingSigned_clone(orig: number): number { if(!isWasmInitialized) { @@ -11504,6 +14091,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.FundingLocked_new(encodeArray(channel_id_arg), encodeArray(next_per_commitment_point_arg)); return nativeResponseValue; } + // uint64_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg); + export function FundingLocked_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.FundingLocked_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); export function FundingLocked_clone(orig: number): number { if(!isWasmInitialized) { @@ -11560,6 +14155,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Shutdown_new(encodeArray(channel_id_arg), encodeArray(scriptpubkey_arg)); return nativeResponseValue; } + // uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg); + export function Shutdown_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Shutdown_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); export function Shutdown_clone(orig: number): number { if(!isWasmInitialized) { @@ -11616,6 +14219,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); return nativeResponseValue; } + // uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg); + export function ClosingSignedFeeRange_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig); export function ClosingSignedFeeRange_clone(orig: number): number { if(!isWasmInitialized) { @@ -11704,6 +14315,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ClosingSigned_new(encodeArray(channel_id_arg), fee_satoshis_arg, encodeArray(signature_arg), fee_range_arg); return nativeResponseValue; } + // uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg); + export function ClosingSigned_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSigned_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); export function ClosingSigned_clone(orig: number): number { if(!isWasmInitialized) { @@ -11800,6 +14419,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateAddHTLC_set_cltv_expiry(this_ptr, val); // debug statements here } + // uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg); + export function UpdateAddHTLC_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UpdateAddHTLC_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); export function UpdateAddHTLC_clone(orig: number): number { if(!isWasmInitialized) { @@ -11872,6 +14499,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateFulfillHTLC_new(encodeArray(channel_id_arg), htlc_id_arg, encodeArray(payment_preimage_arg)); return nativeResponseValue; } + // uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg); + export function UpdateFulfillHTLC_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UpdateFulfillHTLC_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); export function UpdateFulfillHTLC_clone(orig: number): number { if(!isWasmInitialized) { @@ -11920,6 +14555,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateFailHTLC_set_htlc_id(this_ptr, val); // debug statements here } + // uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg); + export function UpdateFailHTLC_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UpdateFailHTLC_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig); export function UpdateFailHTLC_clone(orig: number): number { if(!isWasmInitialized) { @@ -11984,6 +14627,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateFailMalformedHTLC_set_failure_code(this_ptr, val); // debug statements here } + // uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg); + export function UpdateFailMalformedHTLC_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UpdateFailMalformedHTLC_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig); export function UpdateFailMalformedHTLC_clone(orig: number): number { if(!isWasmInitialized) { @@ -12048,6 +14699,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentSigned_new(encodeArray(channel_id_arg), encodeArray(signature_arg), htlc_signatures_arg); return nativeResponseValue; } + // uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg); + export function CommitmentSigned_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CommitmentSigned_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); export function CommitmentSigned_clone(orig: number): number { if(!isWasmInitialized) { @@ -12120,6 +14779,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RevokeAndACK_new(encodeArray(channel_id_arg), encodeArray(per_commitment_secret_arg), encodeArray(next_per_commitment_point_arg)); return nativeResponseValue; } + // uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg); + export function RevokeAndACK_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RevokeAndACK_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); export function RevokeAndACK_clone(orig: number): number { if(!isWasmInitialized) { @@ -12176,6 +14843,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UpdateFee_new(encodeArray(channel_id_arg), feerate_per_kw_arg); return nativeResponseValue; } + // uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg); + export function UpdateFee_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UpdateFee_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); export function UpdateFee_clone(orig: number): number { if(!isWasmInitialized) { @@ -12232,6 +14907,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DataLossProtect_new(encodeArray(your_last_per_commitment_secret_arg), encodeArray(my_current_per_commitment_point_arg)); return nativeResponseValue; } + // uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg); + export function DataLossProtect_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DataLossProtect_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); export function DataLossProtect_clone(orig: number): number { if(!isWasmInitialized) { @@ -12296,6 +14979,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelReestablish_set_next_remote_commitment_number(this_ptr, val); // debug statements here } + // uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg); + export function ChannelReestablish_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelReestablish_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); export function ChannelReestablish_clone(orig: number): number { if(!isWasmInitialized) { @@ -12384,6 +15075,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.AnnouncementSignatures_new(encodeArray(channel_id_arg), short_channel_id_arg, encodeArray(node_signature_arg), encodeArray(bitcoin_signature_arg)); return nativeResponseValue; } + // uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg); + export function AnnouncementSignatures_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.AnnouncementSignatures_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig); export function AnnouncementSignatures_clone(orig: number): number { if(!isWasmInitialized) { @@ -12400,6 +15099,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetAddress_free(this_ptr); // debug statements here } + // uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg); + export function NetAddress_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetAddress_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig); export function NetAddress_clone(orig: number): number { if(!isWasmInitialized) { @@ -12552,6 +15259,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UnsignedNodeAnnouncement_set_addresses(this_ptr, val); // debug statements here } + // uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg); + export function UnsignedNodeAnnouncement_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UnsignedNodeAnnouncement_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); export function UnsignedNodeAnnouncement_clone(orig: number): number { if(!isWasmInitialized) { @@ -12608,6 +15323,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NodeAnnouncement_new(encodeArray(signature_arg), contents_arg); return nativeResponseValue; } + // uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg); + export function NodeAnnouncement_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NodeAnnouncement_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); export function NodeAnnouncement_clone(orig: number): number { if(!isWasmInitialized) { @@ -12736,6 +15459,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr, encodeArray(val)); // debug statements here } + // uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg); + export function UnsignedChannelAnnouncement_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UnsignedChannelAnnouncement_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); export function UnsignedChannelAnnouncement_clone(orig: number): number { if(!isWasmInitialized) { @@ -12840,6 +15571,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelAnnouncement_new(encodeArray(node_signature_1_arg), encodeArray(node_signature_2_arg), encodeArray(bitcoin_signature_1_arg), encodeArray(bitcoin_signature_2_arg), contents_arg); return nativeResponseValue; } + // uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg); + export function ChannelAnnouncement_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelAnnouncement_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); export function ChannelAnnouncement_clone(orig: number): number { if(!isWasmInitialized) { @@ -12984,6 +15723,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr, val); // debug statements here } + // uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg); + export function UnsignedChannelUpdate_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.UnsignedChannelUpdate_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); export function UnsignedChannelUpdate_clone(orig: number): number { if(!isWasmInitialized) { @@ -13040,6 +15787,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelUpdate_new(encodeArray(signature_arg), contents_arg); return nativeResponseValue; } + // uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg); + export function ChannelUpdate_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelUpdate_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); export function ChannelUpdate_clone(orig: number): number { if(!isWasmInitialized) { @@ -13112,6 +15867,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.QueryChannelRange_new(encodeArray(chain_hash_arg), first_blocknum_arg, number_of_blocks_arg); return nativeResponseValue; } + // uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg); + export function QueryChannelRange_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.QueryChannelRange_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); export function QueryChannelRange_clone(orig: number): number { if(!isWasmInitialized) { @@ -13208,6 +15971,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ReplyChannelRange_new(encodeArray(chain_hash_arg), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg); return nativeResponseValue; } + // uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg); + export function ReplyChannelRange_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ReplyChannelRange_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); export function ReplyChannelRange_clone(orig: number): number { if(!isWasmInitialized) { @@ -13256,6 +16027,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.QueryShortChannelIds_new(encodeArray(chain_hash_arg), short_channel_ids_arg); return nativeResponseValue; } + // uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg); + export function QueryShortChannelIds_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.QueryShortChannelIds_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); export function QueryShortChannelIds_clone(orig: number): number { if(!isWasmInitialized) { @@ -13312,6 +16091,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_new(encodeArray(chain_hash_arg), full_information_arg); return nativeResponseValue; } + // uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg); + export function ReplyShortChannelIdsEnd_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); export function ReplyShortChannelIdsEnd_clone(orig: number): number { if(!isWasmInitialized) { @@ -13384,6 +16171,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.GossipTimestampFilter_new(encodeArray(chain_hash_arg), first_timestamp_arg, timestamp_range_arg); return nativeResponseValue; } + // uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg); + export function GossipTimestampFilter_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.GossipTimestampFilter_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); export function GossipTimestampFilter_clone(orig: number): number { if(!isWasmInitialized) { @@ -13400,6 +16195,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ErrorAction_free(this_ptr); // debug statements here } + // uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg); + export function ErrorAction_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ErrorAction_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); export function ErrorAction_clone(orig: number): number { if(!isWasmInitialized) { @@ -13488,6 +16291,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.LightningError_new(err_arg, action_arg); return nativeResponseValue; } + // uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg); + export function LightningError_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.LightningError_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig); export function LightningError_clone(orig: number): number { if(!isWasmInitialized) { @@ -13608,6 +16419,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentUpdate_new(update_add_htlcs_arg, update_fulfill_htlcs_arg, update_fail_htlcs_arg, update_fail_malformed_htlcs_arg, update_fee_arg, commitment_signed_arg); return nativeResponseValue; } + // uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg); + export function CommitmentUpdate_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CommitmentUpdate_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig); export function CommitmentUpdate_clone(orig: number): number { if(!isWasmInitialized) { @@ -14288,6 +17107,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MessageHandler_new(chan_handler_arg, route_handler_arg); return nativeResponseValue; } + // uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg); + export function SocketDescriptor_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SocketDescriptor_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig); export function SocketDescriptor_clone(orig: number): number { if(!isWasmInitialized) { @@ -14336,6 +17163,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PeerHandleError_new(no_connection_possible_arg); return nativeResponseValue; } + // uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg); + export function PeerHandleError_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PeerHandleError_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig); export function PeerHandleError_clone(orig: number): number { if(!isWasmInitialized) { @@ -14584,6 +17419,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.TxCreationKeys_new(encodeArray(per_commitment_point_arg), encodeArray(revocation_key_arg), encodeArray(broadcaster_htlc_key_arg), encodeArray(countersignatory_htlc_key_arg), encodeArray(broadcaster_delayed_payment_key_arg)); return nativeResponseValue; } + // uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg); + export function TxCreationKeys_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TxCreationKeys_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig); export function TxCreationKeys_clone(orig: number): number { if(!isWasmInitialized) { @@ -14704,6 +17547,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelPublicKeys_new(encodeArray(funding_pubkey_arg), encodeArray(revocation_basepoint_arg), encodeArray(payment_point_arg), encodeArray(delayed_payment_basepoint_arg), encodeArray(htlc_basepoint_arg)); return nativeResponseValue; } + // uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg); + export function ChannelPublicKeys_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelPublicKeys_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig); export function ChannelPublicKeys_clone(orig: number): number { if(!isWasmInitialized) { @@ -14848,6 +17699,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, encodeArray(payment_hash_arg), transaction_output_index_arg); return nativeResponseValue; } + // uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg); + export function HTLCOutputInCommitment_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HTLCOutputInCommitment_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); export function HTLCOutputInCommitment_clone(orig: number): number { if(!isWasmInitialized) { @@ -14992,6 +17851,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelTransactionParameters_new(holder_pubkeys_arg, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg, funding_outpoint_arg); return nativeResponseValue; } + // uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg); + export function ChannelTransactionParameters_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelTransactionParameters_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); export function ChannelTransactionParameters_clone(orig: number): number { if(!isWasmInitialized) { @@ -15048,6 +17915,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CounterpartyChannelTransactionParameters_new(pubkeys_arg, selected_contest_delay_arg); return nativeResponseValue; } + // uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg); + export function CounterpartyChannelTransactionParameters_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyChannelTransactionParameters_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig); export function CounterpartyChannelTransactionParameters_clone(orig: number): number { if(!isWasmInitialized) { @@ -15192,6 +18067,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this_ptr, val); // debug statements here } + // uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg); + export function HolderCommitmentTransaction_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HolderCommitmentTransaction_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig); export function HolderCommitmentTransaction_clone(orig: number): number { if(!isWasmInitialized) { @@ -15272,6 +18155,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BuiltCommitmentTransaction_new(encodeArray(transaction_arg), encodeArray(txid_arg)); return nativeResponseValue; } + // uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg); + export function BuiltCommitmentTransaction_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.BuiltCommitmentTransaction_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig); export function BuiltCommitmentTransaction_clone(orig: number): number { if(!isWasmInitialized) { @@ -15320,6 +18211,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ClosingTransaction_free(this_obj); // debug statements here } + // uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg); + export function ClosingTransaction_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig); export function ClosingTransaction_clone(orig: number): number { if(!isWasmInitialized) { @@ -15432,6 +18331,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentTransaction_free(this_obj); // debug statements here } + // uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg); + export function CommitmentTransaction_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CommitmentTransaction_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig); export function CommitmentTransaction_clone(orig: number): number { if(!isWasmInitialized) { @@ -15584,6 +18491,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InvoiceFeatures_eq(a, b); return nativeResponseValue; } + // uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); + export function InitFeatures_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InitFeatures_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig); export function InitFeatures_clone(orig: number): number { if(!isWasmInitialized) { @@ -15592,6 +18507,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InitFeatures_clone(orig); return nativeResponseValue; } + // uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg); + export function NodeFeatures_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NodeFeatures_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig); export function NodeFeatures_clone(orig: number): number { if(!isWasmInitialized) { @@ -15600,6 +18523,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NodeFeatures_clone(orig); return nativeResponseValue; } + // uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg); + export function ChannelFeatures_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelFeatures_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); export function ChannelFeatures_clone(orig: number): number { if(!isWasmInitialized) { @@ -15608,6 +18539,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelFeatures_clone(orig); return nativeResponseValue; } + // uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg); + export function InvoiceFeatures_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoiceFeatures_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig); export function InvoiceFeatures_clone(orig: number): number { if(!isWasmInitialized) { @@ -15840,6 +18779,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ShutdownScript_free(this_obj); // debug statements here } + // uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg); + export function ShutdownScript_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig); export function ShutdownScript_clone(orig: number): number { if(!isWasmInitialized) { @@ -15880,6 +18827,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InvalidShutdownScript_new(encodeArray(script_arg)); return nativeResponseValue; } + // uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg); + export function InvalidShutdownScript_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvalidShutdownScript_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig); export function InvalidShutdownScript_clone(orig: number): number { if(!isWasmInitialized) { @@ -15960,6 +18915,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CustomMessageReader_free(this_ptr); // debug statements here } + // uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg); + export function Type_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Type_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig); export function Type_clone(orig: number): number { if(!isWasmInitialized) { @@ -16016,6 +18979,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NodeId_free(this_obj); // debug statements here } + // uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg); + export function NodeId_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NodeId_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig); export function NodeId_clone(orig: number): number { if(!isWasmInitialized) { @@ -16072,6 +19043,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_free(this_obj); // debug statements here } + // uint64_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg); + export function NetworkGraph_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetworkGraph_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig); export function NetworkGraph_clone(orig: number): number { if(!isWasmInitialized) { @@ -16096,6 +19075,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkUpdate_free(this_ptr); // debug statements here } + // uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg); + export function NetworkUpdate_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetworkUpdate_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig); export function NetworkUpdate_clone(orig: number): number { if(!isWasmInitialized) { @@ -16136,6 +19123,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkUpdate_write(obj); return decodeArray(nativeResponseValue); } + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser); + export function NetworkUpdate_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetworkUpdate_read(encodeArray(ser)); + return nativeResponseValue; + } // struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); export function NetGraphMsgHandler_as_EventHandler(this_arg: number): number { if(!isWasmInitialized) { @@ -16312,6 +19307,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg, last_update_message_arg); return nativeResponseValue; } + // uint64_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg); + export function DirectionalChannelInfo_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DirectionalChannelInfo_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig); export function DirectionalChannelInfo_clone(orig: number): number { if(!isWasmInitialized) { @@ -16464,6 +19467,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelInfo_new(features_arg, node_one_arg, one_to_two_arg, node_two_arg, two_to_one_arg, capacity_sats_arg, announcement_message_arg); return nativeResponseValue; } + // uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg); + export function ChannelInfo_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelInfo_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig); export function ChannelInfo_clone(orig: number): number { if(!isWasmInitialized) { @@ -16544,6 +19555,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingFees_eq(a, b); return nativeResponseValue; } + // uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg); + export function RoutingFees_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RoutingFees_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); export function RoutingFees_clone(orig: number): number { if(!isWasmInitialized) { @@ -16680,6 +19699,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NodeAnnouncementInfo_new(features_arg, last_update_arg, encodeArray(rgb_arg), encodeArray(alias_arg), addresses_arg, announcement_message_arg); return nativeResponseValue; } + // uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg); + export function NodeAnnouncementInfo_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NodeAnnouncementInfo_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig); export function NodeAnnouncementInfo_clone(orig: number): number { if(!isWasmInitialized) { @@ -16760,6 +19787,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg, announcement_info_arg); return nativeResponseValue; } + // uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg); + export function NodeInfo_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NodeInfo_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig); export function NodeInfo_clone(orig: number): number { if(!isWasmInitialized) { @@ -17000,6 +20035,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RouteHop_new(encodeArray(pubkey_arg), node_features_arg, short_channel_id_arg, channel_features_arg, fee_msat_arg, cltv_expiry_delta_arg); return nativeResponseValue; } + // uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg); + export function RouteHop_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); export function RouteHop_clone(orig: number): number { if(!isWasmInitialized) { @@ -17088,6 +20131,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Route_new(paths_arg, payee_arg); return nativeResponseValue; } + // uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg); + export function Route_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); export function Route_clone(orig: number): number { if(!isWasmInitialized) { @@ -17208,6 +20259,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RouteParameters_new(payee_arg, final_value_msat_arg, final_cltv_expiry_delta_arg); return nativeResponseValue; } + // uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg); + export function RouteParameters_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig); export function RouteParameters_clone(orig: number): number { if(!isWasmInitialized) { @@ -17312,6 +20371,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Payee_new(encodeArray(pubkey_arg), features_arg, route_hints_arg, expiry_time_arg); return nativeResponseValue; } + // uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg); + export function Payee_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig); export function Payee_clone(orig: number): number { if(!isWasmInitialized) { @@ -17400,6 +20467,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RouteHint_new(a_arg); return nativeResponseValue; } + // uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg); + export function RouteHint_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); export function RouteHint_clone(orig: number): number { if(!isWasmInitialized) { @@ -17552,6 +20627,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RouteHintHop_new(encodeArray(src_node_id_arg), short_channel_id_arg, fees_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg); return nativeResponseValue; } + // uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg); + export function RouteHintHop_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); export function RouteHintHop_clone(orig: number): number { if(!isWasmInitialized) { @@ -17848,6 +20931,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Invoice_eq(a, b); return nativeResponseValue; } + // uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg); + export function Invoice_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Invoice_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig); export function Invoice_clone(orig: number): number { if(!isWasmInitialized) { @@ -17872,6 +20963,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SignedRawInvoice_eq(a, b); return nativeResponseValue; } + // uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg); + export function SignedRawInvoice_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SignedRawInvoice_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig); export function SignedRawInvoice_clone(orig: number): number { if(!isWasmInitialized) { @@ -17912,6 +21011,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RawInvoice_eq(a, b); return nativeResponseValue; } + // uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg); + export function RawInvoice_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RawInvoice_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig); export function RawInvoice_clone(orig: number): number { if(!isWasmInitialized) { @@ -17952,6 +21059,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RawDataPart_eq(a, b); return nativeResponseValue; } + // uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg); + export function RawDataPart_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RawDataPart_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig); export function RawDataPart_clone(orig: number): number { if(!isWasmInitialized) { @@ -17976,6 +21091,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PositiveTimestamp_eq(a, b); return nativeResponseValue; } + // uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg); + export function PositiveTimestamp_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PositiveTimestamp_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig); export function PositiveTimestamp_clone(orig: number): number { if(!isWasmInitialized) { @@ -18112,6 +21235,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Sha256_free(this_obj); // debug statements here } + // uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg); + export function Sha256_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Sha256_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig); export function Sha256_clone(orig: number): number { if(!isWasmInitialized) { @@ -18144,6 +21275,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Description_free(this_obj); // debug statements here } + // uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg); + export function Description_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Description_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig); export function Description_clone(orig: number): number { if(!isWasmInitialized) { @@ -18200,6 +21339,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PayeePubKey_new(encodeArray(a_arg)); return nativeResponseValue; } + // uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg); + export function PayeePubKey_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PayeePubKey_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig); export function PayeePubKey_clone(orig: number): number { if(!isWasmInitialized) { @@ -18232,6 +21379,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ExpiryTime_free(this_obj); // debug statements here } + // uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg); + export function ExpiryTime_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ExpiryTime_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig); export function ExpiryTime_clone(orig: number): number { if(!isWasmInitialized) { @@ -18288,6 +21443,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MinFinalCltvExpiry_new(a_arg); return nativeResponseValue; } + // uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg); + export function MinFinalCltvExpiry_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MinFinalCltvExpiry_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig); export function MinFinalCltvExpiry_clone(orig: number): number { if(!isWasmInitialized) { @@ -18320,6 +21483,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Fallback_free(this_ptr); // debug statements here } + // uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg); + export function Fallback_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Fallback_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig); export function Fallback_clone(orig: number): number { if(!isWasmInitialized) { @@ -18376,6 +21547,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InvoiceSignature_free(this_obj); // debug statements here } + // uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg); + export function InvoiceSignature_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoiceSignature_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig); export function InvoiceSignature_clone(orig: number): number { if(!isWasmInitialized) { @@ -18400,6 +21579,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PrivateRoute_free(this_obj); // debug statements here } + // uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg); + export function PrivateRoute_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PrivateRoute_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig); export function PrivateRoute_clone(orig: number): number { if(!isWasmInitialized) { @@ -18960,6 +22147,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SignOrCreationError_free(this_ptr); // debug statements here } + // uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg); + export function SignOrCreationError_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SignOrCreationError_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig); export function SignOrCreationError_clone(orig: number): number { if(!isWasmInitialized) { @@ -19056,6 +22251,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RetryAttempts_new(a_arg); return nativeResponseValue; } + // uint64_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg); + export function RetryAttempts_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RetryAttempts_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig); export function RetryAttempts_clone(orig: number): number { if(!isWasmInitialized) { @@ -19088,6 +22291,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PaymentError_free(this_ptr); // debug statements here } + // uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg); + export function PaymentError_clone_ptr(arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentError_clone_ptr(arg); + return nativeResponseValue; + } // struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig); export function PaymentError_clone(orig: number): number { if(!isWasmInitialized) { diff --git a/ts/enums/AccessError.ts b/ts/enums/AccessError.ts index 7d913f2d..fcbdf0f7 100644 --- a/ts/enums/AccessError.ts +++ b/ts/enums/AccessError.ts @@ -1,6 +1,12 @@ export enum AccessError { - LDKAccessError_UnknownChain, - LDKAccessError_UnknownTx, + /** + * The requested chain is unknown. + */ +LDKAccessError_UnknownChain, + /** + * The requested transaction doesn't exist or hasn't confirmed. + */ +LDKAccessError_UnknownTx, } diff --git a/ts/enums/ChannelMonitorUpdateErr.ts b/ts/enums/ChannelMonitorUpdateErr.ts index 934306ba..0e32c6e8 100644 --- a/ts/enums/ChannelMonitorUpdateErr.ts +++ b/ts/enums/ChannelMonitorUpdateErr.ts @@ -1,6 +1,68 @@ export enum ChannelMonitorUpdateErr { - LDKChannelMonitorUpdateErr_TemporaryFailure, - LDKChannelMonitorUpdateErr_PermanentFailure, + /** + * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of +our state failed, but is expected to succeed at some point in the future). + +Such a failure will \"freeze\" a channel, preventing us from revoking old states or +submitting new commitment transactions to the counterparty. Once the update(s) that failed +have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned +via [`Watch::release_pending_monitor_events`] which will then restore the channel to an +operational state. + +Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If +you return a TemporaryFailure you must ensure that it is written to disk safely before +writing out the latest ChannelManager state. + +Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur +(eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting +to claim it on this channel) and those updates must be applied wherever they can be. At +least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should +be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to +the channel which would invalidate previous ChannelMonitors are not made when a channel has +been \"frozen\". + +Note that even if updates made after TemporaryFailure succeed you must still provide a +[`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable +normal channel operation. Note that this is normally generated through a call to +[`ChainMonitor::channel_monitor_updated`]. + +Note that the update being processed here will not be replayed for you when you return a +[`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so +you must store the update itself on your own local disk prior to returning a +TemporaryFailure. You may, of course, employ a journaling approach, storing only the +ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at +reload-time. + +For deployments where a copy of ChannelMonitors and other local state are backed up in a +remote location (with local copies persisted immediately), it is anticipated that all +updates will return TemporaryFailure until the remote copies could be updated. + +[`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated + */ +LDKChannelMonitorUpdateErr_TemporaryFailure, + /** + * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a +different watchtower and cannot update with all watchtowers that were previously informed +of this channel). + +At reception of this error, ChannelManager will force-close the channel and return at +least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at +least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel +update must be rejected. + +This failure may also signal a failure to update the local persisted copy of one of +the channel monitor instance. + +Note that even when you fail a holder commitment transaction update, you must store the +update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor +broadcasts it (e.g distributed channel-monitor deployment) + +In case of distributed watchtowers deployment, the new version must be written to disk, as +state may have been stored but rejected due to a block forcing a commitment broadcast. This +storage is used to claim outputs of rejected state confirmed onchain by another watchtower, +lagging behind on block processing. + */ +LDKChannelMonitorUpdateErr_PermanentFailure, } diff --git a/ts/enums/ConfirmationTarget.ts b/ts/enums/ConfirmationTarget.ts index 55a06099..25afe797 100644 --- a/ts/enums/ConfirmationTarget.ts +++ b/ts/enums/ConfirmationTarget.ts @@ -1,7 +1,16 @@ export enum ConfirmationTarget { - LDKConfirmationTarget_Background, - LDKConfirmationTarget_Normal, - LDKConfirmationTarget_HighPriority, + /** + * We are happy with this transaction confirming slowly when feerate drops some. + */ +LDKConfirmationTarget_Background, + /** + * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine. + */ +LDKConfirmationTarget_Normal, + /** + * We'd like this transaction to confirm in the next few blocks. + */ +LDKConfirmationTarget_HighPriority, } diff --git a/ts/enums/CreationError.ts b/ts/enums/CreationError.ts index 8570e7ca..b3ce7f1e 100644 --- a/ts/enums/CreationError.ts +++ b/ts/enums/CreationError.ts @@ -1,8 +1,20 @@ export enum CreationError { - LDKCreationError_DescriptionTooLong, - LDKCreationError_RouteTooLong, - LDKCreationError_TimestampOutOfBounds, - LDKCreationError_ExpiryTimeOutOfBounds, + /** + * The supplied description string was longer than 639 __bytes__ (see [`Description::new(...)`](./struct.Description.html#method.new)) + */ +LDKCreationError_DescriptionTooLong, + /** + * The specified route has too many hops and can't be encoded + */ +LDKCreationError_RouteTooLong, + /** + * The unix timestamp of the supplied date is <0 or can't be represented as `SystemTime` + */ +LDKCreationError_TimestampOutOfBounds, + /** + * The supplied expiry time could cause an overflow if added to a `PositiveTimestamp` + */ +LDKCreationError_ExpiryTimeOutOfBounds, } diff --git a/ts/enums/Currency.ts b/ts/enums/Currency.ts index c7b34f98..c8a63787 100644 --- a/ts/enums/Currency.ts +++ b/ts/enums/Currency.ts @@ -1,9 +1,24 @@ export enum Currency { - LDKCurrency_Bitcoin, - LDKCurrency_BitcoinTestnet, - LDKCurrency_Regtest, - LDKCurrency_Simnet, - LDKCurrency_Signet, + /** + * Bitcoin mainnet + */ +LDKCurrency_Bitcoin, + /** + * Bitcoin testnet + */ +LDKCurrency_BitcoinTestnet, + /** + * Bitcoin regtest + */ +LDKCurrency_Regtest, + /** + * Bitcoin simnet + */ +LDKCurrency_Simnet, + /** + * Bitcoin signet + */ +LDKCurrency_Signet, } diff --git a/ts/enums/Level.ts b/ts/enums/Level.ts index ba44f740..3c159f7e 100644 --- a/ts/enums/Level.ts +++ b/ts/enums/Level.ts @@ -1,9 +1,24 @@ export enum Level { - LDKLevel_Trace, - LDKLevel_Debug, - LDKLevel_Info, - LDKLevel_Warn, - LDKLevel_Error, + /** + * Designates very low priority, often extremely verbose, information + */ +LDKLevel_Trace, + /** + * Designates lower priority information + */ +LDKLevel_Debug, + /** + * Designates useful information + */ +LDKLevel_Info, + /** + * Designates hazardous situations + */ +LDKLevel_Warn, + /** + * Designates very serious errors + */ +LDKLevel_Error, } diff --git a/ts/enums/Network.ts b/ts/enums/Network.ts index 980490e9..c871fadc 100644 --- a/ts/enums/Network.ts +++ b/ts/enums/Network.ts @@ -1,8 +1,20 @@ export enum Network { - LDKNetwork_Bitcoin, - LDKNetwork_Testnet, - LDKNetwork_Regtest, - LDKNetwork_Signet, + /** + * The main Bitcoin blockchain. + */ +LDKNetwork_Bitcoin, + /** + * The testnet3 blockchain. + */ +LDKNetwork_Testnet, + /** + * A local test blockchain. + */ +LDKNetwork_Regtest, + /** + * A blockchain on which blocks are signed instead of mined. + */ +LDKNetwork_Signet, } diff --git a/ts/enums/Secp256k1Error.ts b/ts/enums/Secp256k1Error.ts index b116382f..eef54a9b 100644 --- a/ts/enums/Secp256k1Error.ts +++ b/ts/enums/Secp256k1Error.ts @@ -1,13 +1,40 @@ export enum Secp256k1Error { - LDKSecp256k1Error_IncorrectSignature, - LDKSecp256k1Error_InvalidMessage, - LDKSecp256k1Error_InvalidPublicKey, - LDKSecp256k1Error_InvalidSignature, - LDKSecp256k1Error_InvalidSecretKey, - LDKSecp256k1Error_InvalidRecoveryId, - LDKSecp256k1Error_InvalidTweak, - LDKSecp256k1Error_TweakCheckFailed, - LDKSecp256k1Error_NotEnoughMemory, + /** + * Signature failed verification + */ +LDKSecp256k1Error_IncorrectSignature, + /** + * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant) + */ +LDKSecp256k1Error_InvalidMessage, + /** + * Bad public key + */ +LDKSecp256k1Error_InvalidPublicKey, + /** + * Bad signature + */ +LDKSecp256k1Error_InvalidSignature, + /** + * Bad secret key + */ +LDKSecp256k1Error_InvalidSecretKey, + /** + * Bad recovery id + */ +LDKSecp256k1Error_InvalidRecoveryId, + /** + * Invalid tweak for add_assign or mul_assign + */ +LDKSecp256k1Error_InvalidTweak, + /** + * tweak_add_check failed on an xonly public key + */ +LDKSecp256k1Error_TweakCheckFailed, + /** + * Didn't pass enough memory to context creation with preallocated memory + */ +LDKSecp256k1Error_NotEnoughMemory, } diff --git a/ts/enums/SemanticError.ts b/ts/enums/SemanticError.ts index a296463a..ea1655f9 100644 --- a/ts/enums/SemanticError.ts +++ b/ts/enums/SemanticError.ts @@ -1,14 +1,45 @@ export enum SemanticError { - LDKSemanticError_NoPaymentHash, - LDKSemanticError_MultiplePaymentHashes, - LDKSemanticError_NoDescription, - LDKSemanticError_MultipleDescriptions, - LDKSemanticError_NoPaymentSecret, - LDKSemanticError_MultiplePaymentSecrets, - LDKSemanticError_InvalidFeatures, - LDKSemanticError_InvalidRecoveryId, - LDKSemanticError_InvalidSignature, - LDKSemanticError_ImpreciseAmount, + /** + * The invoice is missing the mandatory payment hash + */ +LDKSemanticError_NoPaymentHash, + /** + * The invoice has multiple payment hashes which isn't allowed + */ +LDKSemanticError_MultiplePaymentHashes, + /** + * No description or description hash are part of the invoice + */ +LDKSemanticError_NoDescription, + /** + * The invoice contains multiple descriptions and/or description hashes which isn't allowed + */ +LDKSemanticError_MultipleDescriptions, + /** + * The invoice is missing the mandatory payment secret, which all modern lightning nodes +should provide. + */ +LDKSemanticError_NoPaymentSecret, + /** + * The invoice contains multiple payment secrets + */ +LDKSemanticError_MultiplePaymentSecrets, + /** + * The invoice's features are invalid + */ +LDKSemanticError_InvalidFeatures, + /** + * The recovery id doesn't fit the signature/pub key + */ +LDKSemanticError_InvalidRecoveryId, + /** + * The invoice's signature is invalid + */ +LDKSemanticError_InvalidSignature, + /** + * The invoice's amount was not a whole number of millisatoshis + */ +LDKSemanticError_ImpreciseAmount, } diff --git a/ts/enums/SiPrefix.ts b/ts/enums/SiPrefix.ts index dbc39aca..5f25c853 100644 --- a/ts/enums/SiPrefix.ts +++ b/ts/enums/SiPrefix.ts @@ -1,8 +1,20 @@ export enum SiPrefix { - LDKSiPrefix_Milli, - LDKSiPrefix_Micro, - LDKSiPrefix_Nano, - LDKSiPrefix_Pico, + /** + * 10^-3 + */ +LDKSiPrefix_Milli, + /** + * 10^-6 + */ +LDKSiPrefix_Micro, + /** + * 10^-9 + */ +LDKSiPrefix_Nano, + /** + * 10^-12 + */ +LDKSiPrefix_Pico, } diff --git a/ts/structs/APIError.ts b/ts/structs/APIError.ts index 7b68692c..61fdaef0 100644 --- a/ts/structs/APIError.ts +++ b/ts/structs/APIError.ts @@ -77,6 +77,11 @@ export class IncompatibleShutdownScript extends APIError { this.script = script_hu_conv; } } + public number clone_ptr() { + number ret = bindings.APIError_clone_ptr(this.ptr); + return ret; + } + public APIError clone() { number ret = bindings.APIError_clone(this.ptr); APIError ret_hu_conv = APIError.constr_from_ptr(ret); diff --git a/ts/structs/AcceptChannel.ts b/ts/structs/AcceptChannel.ts index ba21a7ca..4e102c77 100644 --- a/ts/structs/AcceptChannel.ts +++ b/ts/structs/AcceptChannel.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_temporary_channel_id(Uint8Array val) { - bindings.AcceptChannel_set_temporary_channel_id(this.ptr, val); + bindings.AcceptChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_dust_limit_satoshis() { @@ -96,7 +96,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_funding_pubkey(Uint8Array val) { - bindings.AcceptChannel_set_funding_pubkey(this.ptr, val); + bindings.AcceptChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_revocation_basepoint() { @@ -105,7 +105,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_revocation_basepoint(Uint8Array val) { - bindings.AcceptChannel_set_revocation_basepoint(this.ptr, val); + bindings.AcceptChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_payment_point() { @@ -114,7 +114,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_point(Uint8Array val) { - bindings.AcceptChannel_set_payment_point(this.ptr, val); + bindings.AcceptChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_delayed_payment_basepoint() { @@ -123,7 +123,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_delayed_payment_basepoint(Uint8Array val) { - bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, val); + bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_htlc_basepoint() { @@ -132,7 +132,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_htlc_basepoint(Uint8Array val) { - bindings.AcceptChannel_set_htlc_basepoint(this.ptr, val); + bindings.AcceptChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_first_per_commitment_point() { @@ -141,7 +141,12 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_first_per_commitment_point(Uint8Array val) { - bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val); + bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + } + + public number clone_ptr() { + number ret = bindings.AcceptChannel_clone_ptr(this.ptr); + return ret; } public AcceptChannel clone() { diff --git a/ts/structs/Access.ts b/ts/structs/Access.ts index 416f2a14..ccb20fb0 100644 --- a/ts/structs/Access.ts +++ b/ts/structs/Access.ts @@ -34,7 +34,7 @@ import * as bindings from '../bindings' // TODO: figure out location // todo: in-line interface filling get_utxo (genesis_hash: Uint8Array, short_channel_id: number): number { Result_TxOutAccessErrorZ ret = arg.get_utxo(genesis_hash, short_channel_id); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -53,7 +53,7 @@ import * as bindings from '../bindings' // TODO: figure out location held: Access; } public Result_TxOutAccessErrorZ get_utxo(Uint8Array genesis_hash, number short_channel_id) { - number ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id); + number ret = bindings.Access_get_utxo(this.ptr, InternalUtils.check_arr_len(genesis_hash, 32), short_channel_id); Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/AnnouncementSignatures.ts b/ts/structs/AnnouncementSignatures.ts index 78905ec3..808cd55e 100644 --- a/ts/structs/AnnouncementSignatures.ts +++ b/ts/structs/AnnouncementSignatures.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.AnnouncementSignatures_set_channel_id(this.ptr, val); + bindings.AnnouncementSignatures_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_short_channel_id() { @@ -42,7 +42,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_node_signature(Uint8Array val) { - bindings.AnnouncementSignatures_set_node_signature(this.ptr, val); + bindings.AnnouncementSignatures_set_node_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public Uint8Array get_bitcoin_signature() { @@ -51,16 +51,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_bitcoin_signature(Uint8Array val) { - bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, val); + bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public static AnnouncementSignatures constructor_new(Uint8Array channel_id_arg, number short_channel_id_arg, Uint8Array node_signature_arg, Uint8Array bitcoin_signature_arg) { - number ret = bindings.AnnouncementSignatures_new(channel_id_arg, short_channel_id_arg, node_signature_arg, bitcoin_signature_arg); + number ret = bindings.AnnouncementSignatures_new(InternalUtils.check_arr_len(channel_id_arg, 32), short_channel_id_arg, InternalUtils.check_arr_len(node_signature_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_arg, 64)); const ret_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.AnnouncementSignatures_clone_ptr(this.ptr); + return ret; + } + public AnnouncementSignatures clone() { number ret = bindings.AnnouncementSignatures_clone(this.ptr); const ret_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, ret); diff --git a/ts/structs/Balance.ts b/ts/structs/Balance.ts index c7ff0db9..c76978e0 100644 --- a/ts/structs/Balance.ts +++ b/ts/structs/Balance.ts @@ -60,6 +60,11 @@ export class MaybeClaimableHTLCAwaitingTimeout extends Balance { this.claimable_height = obj.claimable_height; } } + public number clone_ptr() { + number ret = bindings.Balance_clone_ptr(this.ptr); + return ret; + } + public Balance clone() { number ret = bindings.Balance_clone(this.ptr); Balance ret_hu_conv = Balance.constr_from_ptr(ret); diff --git a/ts/structs/BaseSign.ts b/ts/structs/BaseSign.ts index 1aa749f6..b76963c7 100644 --- a/ts/structs/BaseSign.ts +++ b/ts/structs/BaseSign.ts @@ -15,7 +15,7 @@ import * as bindings from '../bindings' // TODO: figure out location this.bindings_instance = null; } else { // TODO: private constructor instantiation - super(bindings.LDKBaseSign_new(arg, pubkeys == null ? 0 : pubkeys.ptr & ~1)); + super(bindings.LDKBaseSign_new(arg, pubkeys == null ? 0 : pubkeys.clone_ptr())); this.ptrs_to.push(arg); } @@ -34,77 +34,80 @@ import * as bindings from '../bindings' // TODO: figure out location // todo: in-line interface filling get_per_commitment_point (idx: number): Uint8Array { Uint8Array ret = arg.get_per_commitment_point(idx); - return ret; + result: Uint8Array = InternalUtils.check_arr_len(ret, 33); + return result; }, release_commitment_secret (idx: number): Uint8Array { Uint8Array ret = arg.release_commitment_secret(idx); - return ret; + result: Uint8Array = InternalUtils.check_arr_len(ret, 32); + return result; }, validate_holder_commitment (holder_tx: number): number { const holder_tx_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, holder_tx); Result_NoneNoneZ ret = arg.validate_holder_commitment(holder_tx_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, channel_keys_id (): Uint8Array { Uint8Array ret = arg.channel_keys_id(); - return ret; + result: Uint8Array = InternalUtils.check_arr_len(ret, 32); + return result; }, sign_counterparty_commitment (commitment_tx: number): number { const commitment_tx_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, commitment_tx); Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, validate_counterparty_revocation (idx: number, secret: Uint8Array): number { Result_NoneNoneZ ret = arg.validate_counterparty_revocation(idx, secret); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, sign_holder_commitment_and_htlcs (commitment_tx: number): number { const commitment_tx_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, commitment_tx); Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, sign_justice_revoked_output (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array): number { Result_SignatureNoneZ ret = arg.sign_justice_revoked_output(justice_tx, input, amount, per_commitment_key); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, sign_justice_revoked_htlc (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number { const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc); Result_SignatureNoneZ ret = arg.sign_justice_revoked_htlc(justice_tx, input, amount, per_commitment_key, htlc_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, sign_counterparty_htlc_transaction (htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number { const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc); Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, sign_closing_transaction (closing_tx: number): number { const closing_tx_hu_conv: ClosingTransaction = new ClosingTransaction(null, closing_tx); Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, sign_channel_announcement (msg: number): number { const msg_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, msg); Result_SignatureNoneZ ret = arg.sign_channel_announcement(msg_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -169,7 +172,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result_NoneNoneZ validate_counterparty_revocation(number idx, Uint8Array secret) { - number ret = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, secret); + number ret = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, InternalUtils.check_arr_len(secret, 32)); Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -182,20 +185,20 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result_SignatureNoneZ sign_justice_revoked_output(Uint8Array justice_tx, number input, number amount, Uint8Array per_commitment_key) { - number ret = bindings.BaseSign_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, per_commitment_key); + number ret = bindings.BaseSign_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32)); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } public Result_SignatureNoneZ sign_justice_revoked_htlc(Uint8Array justice_tx, number input, number amount, Uint8Array per_commitment_key, HTLCOutputInCommitment htlc) { - number ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1); + number ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc == null ? 0 : htlc.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); this.ptrs_to.add(htlc); return ret_hu_conv; } public Result_SignatureNoneZ sign_counterparty_htlc_transaction(Uint8Array htlc_tx, number input, number amount, Uint8Array per_commitment_point, HTLCOutputInCommitment htlc) { - number ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1); + number ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc == null ? 0 : htlc.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); this.ptrs_to.add(htlc); return ret_hu_conv; diff --git a/ts/structs/BestBlock.ts b/ts/structs/BestBlock.ts index 439ba0e0..08597ee1 100644 --- a/ts/structs/BestBlock.ts +++ b/ts/structs/BestBlock.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.BestBlock_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.BestBlock_clone_ptr(this.ptr); + return ret; + } + public BestBlock clone() { number ret = bindings.BestBlock_clone(this.ptr); const ret_hu_conv: BestBlock = new BestBlock(null, ret); @@ -33,7 +38,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static BestBlock constructor_new(Uint8Array block_hash, number height) { - number ret = bindings.BestBlock_new(block_hash, height); + number ret = bindings.BestBlock_new(InternalUtils.check_arr_len(block_hash, 32), height); const ret_hu_conv: BestBlock = new BestBlock(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/BuiltCommitmentTransaction.ts b/ts/structs/BuiltCommitmentTransaction.ts index 7d2e387c..a2082dc2 100644 --- a/ts/structs/BuiltCommitmentTransaction.ts +++ b/ts/structs/BuiltCommitmentTransaction.ts @@ -33,16 +33,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_txid(Uint8Array val) { - bindings.BuiltCommitmentTransaction_set_txid(this.ptr, val); + bindings.BuiltCommitmentTransaction_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); } public static BuiltCommitmentTransaction constructor_new(Uint8Array transaction_arg, Uint8Array txid_arg) { - number ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg); + number ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, InternalUtils.check_arr_len(txid_arg, 32)); const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.BuiltCommitmentTransaction_clone_ptr(this.ptr); + return ret; + } + public BuiltCommitmentTransaction clone() { number ret = bindings.BuiltCommitmentTransaction_clone(this.ptr); const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); @@ -67,7 +72,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public Uint8Array sign(Uint8Array funding_key, Uint8Array funding_redeemscript, number channel_value_satoshis) { - Uint8Array ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis); + Uint8Array ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis); return ret; } diff --git a/ts/structs/ChainMonitor.ts b/ts/structs/ChainMonitor.ts index 356c5d4b..e65e42be 100644 --- a/ts/structs/ChainMonitor.ts +++ b/ts/structs/ChainMonitor.ts @@ -22,6 +22,7 @@ import * as bindings from '../bindings' // TODO: figure out location number ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr); const ret_hu_conv: ChainMonitor = new ChainMonitor(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(chain_source); ret_hu_conv.ptrs_to.add(broadcaster); ret_hu_conv.ptrs_to.add(logger); ret_hu_conv.ptrs_to.add(feeest); diff --git a/ts/structs/ChainParameters.ts b/ts/structs/ChainParameters.ts index 292a85f1..cf87765d 100644 --- a/ts/structs/ChainParameters.ts +++ b/ts/structs/ChainParameters.ts @@ -45,6 +45,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChainParameters_clone_ptr(this.ptr); + return ret; + } + public ChainParameters clone() { number ret = bindings.ChainParameters_clone(this.ptr); const ret_hu_conv: ChainParameters = new ChainParameters(null, ret); diff --git a/ts/structs/ChannelAnnouncement.ts b/ts/structs/ChannelAnnouncement.ts index 62e42cbe..d009b06c 100644 --- a/ts/structs/ChannelAnnouncement.ts +++ b/ts/structs/ChannelAnnouncement.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_node_signature_1(Uint8Array val) { - bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, val); + bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, InternalUtils.check_arr_len(val, 64)); } public Uint8Array get_node_signature_2() { @@ -33,7 +33,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_node_signature_2(Uint8Array val) { - bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, val); + bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, InternalUtils.check_arr_len(val, 64)); } public Uint8Array get_bitcoin_signature_1() { @@ -42,7 +42,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_bitcoin_signature_1(Uint8Array val) { - bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, val); + bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, InternalUtils.check_arr_len(val, 64)); } public Uint8Array get_bitcoin_signature_2() { @@ -51,7 +51,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_bitcoin_signature_2(Uint8Array val) { - bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, val); + bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, InternalUtils.check_arr_len(val, 64)); } public UnsignedChannelAnnouncement get_contents() { @@ -66,12 +66,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ChannelAnnouncement constructor_new(Uint8Array node_signature_1_arg, Uint8Array node_signature_2_arg, Uint8Array bitcoin_signature_1_arg, Uint8Array bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) { - number ret = bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + number ret = bindings.ChannelAnnouncement_new(InternalUtils.check_arr_len(node_signature_1_arg, 64), InternalUtils.check_arr_len(node_signature_2_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_1_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_2_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1); const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelAnnouncement_clone_ptr(this.ptr); + return ret; + } + public ChannelAnnouncement clone() { number ret = bindings.ChannelAnnouncement_clone(this.ptr); const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); diff --git a/ts/structs/ChannelConfig.ts b/ts/structs/ChannelConfig.ts index 570630c5..e7e2c979 100644 --- a/ts/structs/ChannelConfig.ts +++ b/ts/structs/ChannelConfig.ts @@ -88,6 +88,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelConfig_clone_ptr(this.ptr); + return ret; + } + public ChannelConfig clone() { number ret = bindings.ChannelConfig_clone(this.ptr); const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); diff --git a/ts/structs/ChannelCounterparty.ts b/ts/structs/ChannelCounterparty.ts index 6e3d03b6..2facb074 100644 --- a/ts/structs/ChannelCounterparty.ts +++ b/ts/structs/ChannelCounterparty.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_node_id(Uint8Array val) { - bindings.ChannelCounterparty_set_node_id(this.ptr, val); + bindings.ChannelCounterparty_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); } public InitFeatures get_features() { @@ -59,12 +59,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ChannelCounterparty constructor_new(Uint8Array node_id_arg, InitFeatures features_arg, number unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg) { - number ret = bindings.ChannelCounterparty_new(node_id_arg, features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1); + number ret = bindings.ChannelCounterparty_new(InternalUtils.check_arr_len(node_id_arg, 33), features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1); const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelCounterparty_clone_ptr(this.ptr); + return ret; + } + public ChannelCounterparty clone() { number ret = bindings.ChannelCounterparty_clone(this.ptr); const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret); diff --git a/ts/structs/ChannelDetails.ts b/ts/structs/ChannelDetails.ts index 07ddf85d..333efbe5 100644 --- a/ts/structs/ChannelDetails.ts +++ b/ts/structs/ChannelDetails.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.ChannelDetails_set_channel_id(this.ptr, val); + bindings.ChannelDetails_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public ChannelCounterparty get_counterparty() { @@ -166,12 +166,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ChannelDetails constructor_new(Uint8Array channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, number channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, number user_channel_id_arg, number outbound_capacity_msat_arg, number inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) { - number ret = bindings.ChannelDetails_new(channel_id_arg, counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); + number ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelDetails_clone_ptr(this.ptr); + return ret; + } + public ChannelDetails clone() { number ret = bindings.ChannelDetails_clone(this.ptr); const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret); diff --git a/ts/structs/ChannelFeatures.ts b/ts/structs/ChannelFeatures.ts index 05694319..305b3a21 100644 --- a/ts/structs/ChannelFeatures.ts +++ b/ts/structs/ChannelFeatures.ts @@ -24,6 +24,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.ChannelFeatures_clone_ptr(this.ptr); + return ret; + } + public ChannelFeatures clone() { number ret = bindings.ChannelFeatures_clone(this.ptr); const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); diff --git a/ts/structs/ChannelHandshakeConfig.ts b/ts/structs/ChannelHandshakeConfig.ts index 1db4cd89..2c06b274 100644 --- a/ts/structs/ChannelHandshakeConfig.ts +++ b/ts/structs/ChannelHandshakeConfig.ts @@ -52,6 +52,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelHandshakeConfig_clone_ptr(this.ptr); + return ret; + } + public ChannelHandshakeConfig clone() { number ret = bindings.ChannelHandshakeConfig_clone(this.ptr); const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); diff --git a/ts/structs/ChannelHandshakeLimits.ts b/ts/structs/ChannelHandshakeLimits.ts index 99b663bb..643c7ffa 100644 --- a/ts/structs/ChannelHandshakeLimits.ts +++ b/ts/structs/ChannelHandshakeLimits.ts @@ -97,6 +97,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelHandshakeLimits_clone_ptr(this.ptr); + return ret; + } + public ChannelHandshakeLimits clone() { number ret = bindings.ChannelHandshakeLimits_clone(this.ptr); const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); diff --git a/ts/structs/ChannelInfo.ts b/ts/structs/ChannelInfo.ts index 2ae6c0e9..0101375d 100644 --- a/ts/structs/ChannelInfo.ts +++ b/ts/structs/ChannelInfo.ts @@ -102,6 +102,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelInfo_clone_ptr(this.ptr); + return ret; + } + public ChannelInfo clone() { number ret = bindings.ChannelInfo_clone(this.ptr); const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret); diff --git a/ts/structs/ChannelManager.ts b/ts/structs/ChannelManager.ts index d9857373..b99a3cba 100644 --- a/ts/structs/ChannelManager.ts +++ b/ts/structs/ChannelManager.ts @@ -38,7 +38,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result__u832APIErrorZ create_channel(Uint8Array their_network_key, number channel_value_satoshis, number push_msat, number user_channel_id, UserConfig override_config) { - number ret = bindings.ChannelManager_create_channel(this.ptr, their_network_key, channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : override_config.ptr & ~1); + number ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.check_arr_len(their_network_key, 33), channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : override_config.ptr & ~1); Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -68,19 +68,19 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result_NoneAPIErrorZ close_channel(Uint8Array channel_id) { - number ret = bindings.ChannelManager_close_channel(this.ptr, channel_id); + number ret = bindings.ChannelManager_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32)); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public Result_NoneAPIErrorZ close_channel_with_target_feerate(Uint8Array channel_id, number target_feerate_sats_per_1000_weight) { - number ret = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, channel_id, target_feerate_sats_per_1000_weight); + number ret = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, InternalUtils.check_arr_len(channel_id, 32), target_feerate_sats_per_1000_weight); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public Result_NoneAPIErrorZ force_close_channel(Uint8Array channel_id) { - number ret = bindings.ChannelManager_force_close_channel(this.ptr, channel_id); + number ret = bindings.ChannelManager_force_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32)); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -90,34 +90,34 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, Uint8Array payment_hash, Uint8Array payment_secret) { - number ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret); + number ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32)); Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); return ret_hu_conv; } public Result_NonePaymentSendFailureZ retry_payment(Route route, Uint8Array payment_id) { - number ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_id); + number ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32)); Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); return ret_hu_conv; } public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ send_spontaneous_payment(Route route, Uint8Array payment_preimage) { - number ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_preimage); + number ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_preimage, 32)); Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); return ret_hu_conv; } public Result_NoneAPIErrorZ funding_transaction_generated(Uint8Array temporary_channel_id, Uint8Array funding_transaction) { - number ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id, funding_transaction); + number ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), funding_transaction); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public void broadcast_node_announcement(Uint8Array rgb, Uint8Array alias, NetAddress[] addresses) { - bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, addresses != null ? Arrays.stream(addresses).map(addresses_conv_12 -> addresses_conv_12.ptr).toArray(number[]::new) : null); + bindings.ChannelManager_broadcast_node_announcement(this.ptr, InternalUtils.check_arr_len(rgb, 3), InternalUtils.check_arr_len(alias, 32), addresses != null ? Arrays.stream(addresses).map(addresses_conv_12 -> addresses_conv_12.ptr).toArray(number[]::new) : null); } public void process_pending_htlc_forwards() { @@ -129,12 +129,12 @@ import * as bindings from '../bindings' // TODO: figure out location } public boolean fail_htlc_backwards(Uint8Array payment_hash) { - boolean ret = bindings.ChannelManager_fail_htlc_backwards(this.ptr, payment_hash); + boolean ret = bindings.ChannelManager_fail_htlc_backwards(this.ptr, InternalUtils.check_arr_len(payment_hash, 32)); return ret; } public boolean claim_funds(Uint8Array payment_preimage) { - boolean ret = bindings.ChannelManager_claim_funds(this.ptr, payment_preimage); + boolean ret = bindings.ChannelManager_claim_funds(this.ptr, InternalUtils.check_arr_len(payment_preimage, 32)); return ret; } @@ -151,7 +151,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash(Uint8Array payment_hash, Option_u64Z min_value_msat, number invoice_expiry_delta_secs, number user_payment_id) { - number ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, payment_hash, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id); + number ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id); Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelManagerPersister.ts b/ts/structs/ChannelManagerPersister.ts index 304b00e9..f6cffb2a 100644 --- a/ts/structs/ChannelManagerPersister.ts +++ b/ts/structs/ChannelManagerPersister.ts @@ -35,7 +35,7 @@ import * as bindings from '../bindings' // TODO: figure out location persist_manager (channel_manager: number): number { const channel_manager_hu_conv: ChannelManager = new ChannelManager(null, channel_manager); Result_NoneErrorZ ret = arg.persist_manager(channel_manager_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, diff --git a/ts/structs/ChannelMessageHandler.ts b/ts/structs/ChannelMessageHandler.ts index 23478b36..bc81d097 100644 --- a/ts/structs/ChannelMessageHandler.ts +++ b/ts/structs/ChannelMessageHandler.ts @@ -171,102 +171,102 @@ import * as bindings from '../bindings' // TODO: figure out location held: ChannelMessageHandler; } public void handle_open_channel(Uint8Array their_node_id, InitFeatures their_features, OpenChannel msg) { - bindings.ChannelMessageHandler_handle_open_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_accept_channel(Uint8Array their_node_id, InitFeatures their_features, AcceptChannel msg) { - bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_funding_created(Uint8Array their_node_id, FundingCreated msg) { - bindings.ChannelMessageHandler_handle_funding_created(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_funding_signed(Uint8Array their_node_id, FundingSigned msg) { - bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_funding_locked(Uint8Array their_node_id, FundingLocked msg) { - bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_shutdown(Uint8Array their_node_id, InitFeatures their_features, Shutdown msg) { - bindings.ChannelMessageHandler_handle_shutdown(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(their_features); this.ptrs_to.add(msg); } public void handle_closing_signed(Uint8Array their_node_id, ClosingSigned msg) { - bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_update_add_htlc(Uint8Array their_node_id, UpdateAddHTLC msg) { - bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_update_fulfill_htlc(Uint8Array their_node_id, UpdateFulfillHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_update_fail_htlc(Uint8Array their_node_id, UpdateFailHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_update_fail_malformed_htlc(Uint8Array their_node_id, UpdateFailMalformedHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_commitment_signed(Uint8Array their_node_id, CommitmentSigned msg) { - bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_revoke_and_ack(Uint8Array their_node_id, RevokeAndACK msg) { - bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_update_fee(Uint8Array their_node_id, UpdateFee msg) { - bindings.ChannelMessageHandler_handle_update_fee(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_announcement_signatures(Uint8Array their_node_id, AnnouncementSignatures msg) { - bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void peer_disconnected(Uint8Array their_node_id, boolean no_connection_possible) { - bindings.ChannelMessageHandler_peer_disconnected(this.ptr, their_node_id, no_connection_possible); + bindings.ChannelMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), no_connection_possible); } public void peer_connected(Uint8Array their_node_id, Init msg) { - bindings.ChannelMessageHandler_peer_connected(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_channel_reestablish(Uint8Array their_node_id, ChannelReestablish msg) { - bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_channel_update(Uint8Array their_node_id, ChannelUpdate msg) { - bindings.ChannelMessageHandler_handle_channel_update(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void handle_error(Uint8Array their_node_id, ErrorMessage msg) { - bindings.ChannelMessageHandler_handle_error(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } diff --git a/ts/structs/ChannelMonitor.ts b/ts/structs/ChannelMonitor.ts index 1ee3bcb6..d0c4a00d 100644 --- a/ts/structs/ChannelMonitor.ts +++ b/ts/structs/ChannelMonitor.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ChannelMonitor_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.ChannelMonitor_clone_ptr(this.ptr); + return ret; + } + public ChannelMonitor clone() { number ret = bindings.ChannelMonitor_clone(this.ptr); const ret_hu_conv: ChannelMonitor = new ChannelMonitor(null, ret); @@ -100,7 +105,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(Uint8Array header, TwoTuple_usizeTransactionZ[] txdata, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, txdata != null ? Arrays.stream(txdata).map(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray(number[]::new) : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).map(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray(number[]::new) : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length]; for (int n = 0; n < ret.length; n++) { number ret_conv_39 = ret[n]; @@ -115,14 +120,14 @@ import * as bindings from '../bindings' // TODO: figure out location } public void block_disconnected(Uint8Array header, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - bindings.ChannelMonitor_block_disconnected(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); } public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(Uint8Array header, TwoTuple_usizeTransactionZ[] txdata, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - number[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).map(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray(number[]::new) : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + number[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).map(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray(number[]::new) : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length]; for (int n = 0; n < ret.length; n++) { number ret_conv_39 = ret[n]; @@ -137,14 +142,14 @@ import * as bindings from '../bindings' // TODO: figure out location } public void transaction_unconfirmed(Uint8Array txid, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, txid, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); } public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(Uint8Array header, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - number[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + number[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length]; for (int n = 0; n < ret.length; n++) { number ret_conv_39 = ret[n]; diff --git a/ts/structs/ChannelMonitorUpdate.ts b/ts/structs/ChannelMonitorUpdate.ts index 80e11cd1..d33e5141 100644 --- a/ts/structs/ChannelMonitorUpdate.ts +++ b/ts/structs/ChannelMonitorUpdate.ts @@ -27,6 +27,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val); } + public number clone_ptr() { + number ret = bindings.ChannelMonitorUpdate_clone_ptr(this.ptr); + return ret; + } + public ChannelMonitorUpdate clone() { number ret = bindings.ChannelMonitorUpdate_clone(this.ptr); const ret_hu_conv: ChannelMonitorUpdate = new ChannelMonitorUpdate(null, ret); diff --git a/ts/structs/ChannelPublicKeys.ts b/ts/structs/ChannelPublicKeys.ts index 758d809b..18fd7697 100644 --- a/ts/structs/ChannelPublicKeys.ts +++ b/ts/structs/ChannelPublicKeys.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_funding_pubkey(Uint8Array val) { - bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, val); + bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_revocation_basepoint() { @@ -33,7 +33,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_revocation_basepoint(Uint8Array val) { - bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val); + bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_payment_point() { @@ -42,7 +42,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_point(Uint8Array val) { - bindings.ChannelPublicKeys_set_payment_point(this.ptr, val); + bindings.ChannelPublicKeys_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_delayed_payment_basepoint() { @@ -51,7 +51,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_delayed_payment_basepoint(Uint8Array val) { - bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val); + bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_htlc_basepoint() { @@ -60,16 +60,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_htlc_basepoint(Uint8Array val) { - bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val); + bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public static ChannelPublicKeys constructor_new(Uint8Array funding_pubkey_arg, Uint8Array revocation_basepoint_arg, Uint8Array payment_point_arg, Uint8Array delayed_payment_basepoint_arg, Uint8Array htlc_basepoint_arg) { - number ret = bindings.ChannelPublicKeys_new(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg); + number ret = bindings.ChannelPublicKeys_new(InternalUtils.check_arr_len(funding_pubkey_arg, 33), InternalUtils.check_arr_len(revocation_basepoint_arg, 33), InternalUtils.check_arr_len(payment_point_arg, 33), InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33), InternalUtils.check_arr_len(htlc_basepoint_arg, 33)); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelPublicKeys_clone_ptr(this.ptr); + return ret; + } + public ChannelPublicKeys clone() { number ret = bindings.ChannelPublicKeys_clone(this.ptr); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); diff --git a/ts/structs/ChannelReestablish.ts b/ts/structs/ChannelReestablish.ts index 0be4b49d..c39a2ec6 100644 --- a/ts/structs/ChannelReestablish.ts +++ b/ts/structs/ChannelReestablish.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.ChannelReestablish_set_channel_id(this.ptr, val); + bindings.ChannelReestablish_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_next_local_commitment_number() { @@ -45,6 +45,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val); } + public number clone_ptr() { + number ret = bindings.ChannelReestablish_clone_ptr(this.ptr); + return ret; + } + public ChannelReestablish clone() { number ret = bindings.ChannelReestablish_clone(this.ptr); const ret_hu_conv: ChannelReestablish = new ChannelReestablish(null, ret); diff --git a/ts/structs/ChannelTransactionParameters.ts b/ts/structs/ChannelTransactionParameters.ts index 31525ff7..7efbc0cf 100644 --- a/ts/structs/ChannelTransactionParameters.ts +++ b/ts/structs/ChannelTransactionParameters.ts @@ -76,6 +76,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelTransactionParameters_clone_ptr(this.ptr); + return ret; + } + public ChannelTransactionParameters clone() { number ret = bindings.ChannelTransactionParameters_clone(this.ptr); const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); diff --git a/ts/structs/ChannelUpdate.ts b/ts/structs/ChannelUpdate.ts index a7a09748..c59b6116 100644 --- a/ts/structs/ChannelUpdate.ts +++ b/ts/structs/ChannelUpdate.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_signature(Uint8Array val) { - bindings.ChannelUpdate_set_signature(this.ptr, val); + bindings.ChannelUpdate_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public UnsignedChannelUpdate get_contents() { @@ -39,12 +39,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ChannelUpdate constructor_new(Uint8Array signature_arg, UnsignedChannelUpdate contents_arg) { - number ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + number ret = bindings.ChannelUpdate_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1); const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ChannelUpdate_clone_ptr(this.ptr); + return ret; + } + public ChannelUpdate clone() { number ret = bindings.ChannelUpdate_clone(this.ptr); const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); diff --git a/ts/structs/ClosingSigned.ts b/ts/structs/ClosingSigned.ts index 8be14a85..c9cd2564 100644 --- a/ts/structs/ClosingSigned.ts +++ b/ts/structs/ClosingSigned.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.ClosingSigned_set_channel_id(this.ptr, val); + bindings.ClosingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_fee_satoshis() { @@ -42,7 +42,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_signature(Uint8Array val) { - bindings.ClosingSigned_set_signature(this.ptr, val); + bindings.ClosingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public ClosingSignedFeeRange get_fee_range() { @@ -57,12 +57,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ClosingSigned constructor_new(Uint8Array channel_id_arg, number fee_satoshis_arg, Uint8Array signature_arg, ClosingSignedFeeRange fee_range_arg) { - number ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg, fee_range_arg == null ? 0 : fee_range_arg.ptr & ~1); + number ret = bindings.ClosingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), fee_satoshis_arg, InternalUtils.check_arr_len(signature_arg, 64), fee_range_arg == null ? 0 : fee_range_arg.ptr & ~1); const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ClosingSigned_clone_ptr(this.ptr); + return ret; + } + public ClosingSigned clone() { number ret = bindings.ClosingSigned_clone(this.ptr); const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret); diff --git a/ts/structs/ClosingSignedFeeRange.ts b/ts/structs/ClosingSignedFeeRange.ts index b3dc2bac..a34f9e39 100644 --- a/ts/structs/ClosingSignedFeeRange.ts +++ b/ts/structs/ClosingSignedFeeRange.ts @@ -43,6 +43,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ClosingSignedFeeRange_clone_ptr(this.ptr); + return ret; + } + public ClosingSignedFeeRange clone() { number ret = bindings.ClosingSignedFeeRange_clone(this.ptr); const ret_hu_conv: ClosingSignedFeeRange = new ClosingSignedFeeRange(null, ret); diff --git a/ts/structs/ClosingTransaction.ts b/ts/structs/ClosingTransaction.ts index 7757ea9c..52f1bc7c 100644 --- a/ts/structs/ClosingTransaction.ts +++ b/ts/structs/ClosingTransaction.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ClosingTransaction_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.ClosingTransaction_clone_ptr(this.ptr); + return ret; + } + public ClosingTransaction clone() { number ret = bindings.ClosingTransaction_clone(this.ptr); const ret_hu_conv: ClosingTransaction = new ClosingTransaction(null, ret); diff --git a/ts/structs/ClosureReason.ts b/ts/structs/ClosureReason.ts index bf2d6fc2..b75406c7 100644 --- a/ts/structs/ClosureReason.ts +++ b/ts/structs/ClosureReason.ts @@ -74,6 +74,11 @@ export class OutdatedChannelManager extends ClosureReason { super(null, ptr); } } + public number clone_ptr() { + number ret = bindings.ClosureReason_clone_ptr(this.ptr); + return ret; + } + public ClosureReason clone() { number ret = bindings.ClosureReason_clone(this.ptr); ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret); diff --git a/ts/structs/CommitmentSigned.ts b/ts/structs/CommitmentSigned.ts index 0c99e819..59def698 100644 --- a/ts/structs/CommitmentSigned.ts +++ b/ts/structs/CommitmentSigned.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.CommitmentSigned_set_channel_id(this.ptr, val); + bindings.CommitmentSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_signature() { @@ -33,20 +33,25 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_signature(Uint8Array val) { - bindings.CommitmentSigned_set_signature(this.ptr, val); + bindings.CommitmentSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public void set_htlc_signatures(Uint8Array[] val) { - bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val); + bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> InternalUtils.check_arr_len(val_conv_12, 64)).toArray(Uint8Array[]::new) : null); } public static CommitmentSigned constructor_new(Uint8Array channel_id_arg, Uint8Array signature_arg, Uint8Array[] htlc_signatures_arg) { - number ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg); + number ret = bindings.CommitmentSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64), htlc_signatures_arg != null ? Arrays.stream(htlc_signatures_arg).map(htlc_signatures_arg_conv_12 -> InternalUtils.check_arr_len(htlc_signatures_arg_conv_12, 64)).toArray(Uint8Array[]::new) : null); const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.CommitmentSigned_clone_ptr(this.ptr); + return ret; + } + public CommitmentSigned clone() { number ret = bindings.CommitmentSigned_clone(this.ptr); const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); diff --git a/ts/structs/CommitmentTransaction.ts b/ts/structs/CommitmentTransaction.ts index 97c85a9f..2a1a96fc 100644 --- a/ts/structs/CommitmentTransaction.ts +++ b/ts/structs/CommitmentTransaction.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.CommitmentTransaction_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.CommitmentTransaction_clone_ptr(this.ptr); + return ret; + } + public CommitmentTransaction clone() { number ret = bindings.CommitmentTransaction_clone(this.ptr); const ret_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, ret); diff --git a/ts/structs/CommitmentUpdate.ts b/ts/structs/CommitmentUpdate.ts index 8fa59235..0c7e3dbc 100644 --- a/ts/structs/CommitmentUpdate.ts +++ b/ts/structs/CommitmentUpdate.ts @@ -111,6 +111,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.CommitmentUpdate_clone_ptr(this.ptr); + return ret; + } + public CommitmentUpdate clone() { number ret = bindings.CommitmentUpdate_clone(this.ptr); const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret); diff --git a/ts/structs/Confirm.ts b/ts/structs/Confirm.ts index f3b6b27d..c991e83c 100644 --- a/ts/structs/Confirm.ts +++ b/ts/structs/Confirm.ts @@ -53,7 +53,8 @@ import * as bindings from '../bindings' // TODO: figure out location get_relevant_txids (): Uint8Array[] { Uint8Array[] ret = arg.get_relevant_txids(); - return ret; + result: Uint8Array[] = ret != null ? Arrays.stream(ret).map(ret_conv_12 -> InternalUtils.check_arr_len(ret_conv_12, 32)).toArray(Uint8Array[]::new) : null; + return result; }, @@ -74,15 +75,15 @@ import * as bindings from '../bindings' // TODO: figure out location held: Confirm; } public void transactions_confirmed(Uint8Array header, TwoTuple_usizeTransactionZ[] txdata, number height) { - bindings.Confirm_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).map(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray(number[]::new) : null, height); + bindings.Confirm_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).map(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray(number[]::new) : null, height); } public void transaction_unconfirmed(Uint8Array txid) { - bindings.Confirm_transaction_unconfirmed(this.ptr, txid); + bindings.Confirm_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32)); } public void best_block_updated(Uint8Array header, number height) { - bindings.Confirm_best_block_updated(this.ptr, header, height); + bindings.Confirm_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height); } public Uint8Array[] get_relevant_txids() { diff --git a/ts/structs/CounterpartyChannelTransactionParameters.ts b/ts/structs/CounterpartyChannelTransactionParameters.ts index dba2820b..140dfb35 100644 --- a/ts/structs/CounterpartyChannelTransactionParameters.ts +++ b/ts/structs/CounterpartyChannelTransactionParameters.ts @@ -45,6 +45,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.CounterpartyChannelTransactionParameters_clone_ptr(this.ptr); + return ret; + } + public CounterpartyChannelTransactionParameters clone() { number ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr); const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); diff --git a/ts/structs/CounterpartyForwardingInfo.ts b/ts/structs/CounterpartyForwardingInfo.ts index ec452c4c..8b8db208 100644 --- a/ts/structs/CounterpartyForwardingInfo.ts +++ b/ts/structs/CounterpartyForwardingInfo.ts @@ -52,6 +52,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.CounterpartyForwardingInfo_clone_ptr(this.ptr); + return ret; + } + public CounterpartyForwardingInfo clone() { number ret = bindings.CounterpartyForwardingInfo_clone(this.ptr); const ret_hu_conv: CounterpartyForwardingInfo = new CounterpartyForwardingInfo(null, ret); diff --git a/ts/structs/CustomMessageHandler.ts b/ts/structs/CustomMessageHandler.ts index 49c3f96c..0791013b 100644 --- a/ts/structs/CustomMessageHandler.ts +++ b/ts/structs/CustomMessageHandler.ts @@ -37,13 +37,13 @@ import * as bindings from '../bindings' // TODO: figure out location Type ret_hu_conv = new Type(null, msg); ret_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_custom_message(ret_hu_conv, sender_node_id); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, get_and_clear_pending_msg (): number[] { TwoTuple_PublicKeyTypeZ[] ret = arg.get_and_clear_pending_msg(); - result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_25 -> ret_conv_25 != null ? ret_conv_25.ptr : 0).toArray(number[]::new) : null; + result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_25 -> ret_conv_25 == null ? 0 : ret_conv_25.clone_ptr()).toArray(number[]::new) : null; return result; }, @@ -63,7 +63,7 @@ import * as bindings from '../bindings' // TODO: figure out location held: CustomMessageHandler; } public Result_NoneLightningErrorZ handle_custom_message(Type msg, Uint8Array sender_node_id) { - number ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, sender_node_id); + number ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33)); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; diff --git a/ts/structs/CustomMessageReader.ts b/ts/structs/CustomMessageReader.ts index e8fb7247..6d57c77e 100644 --- a/ts/structs/CustomMessageReader.ts +++ b/ts/structs/CustomMessageReader.ts @@ -34,7 +34,7 @@ import * as bindings from '../bindings' // TODO: figure out location // todo: in-line interface filling read (message_type: number, buffer: Uint8Array): number { Result_COption_TypeZDecodeErrorZ ret = arg.read(message_type, buffer); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, diff --git a/ts/structs/DataLossProtect.ts b/ts/structs/DataLossProtect.ts index 4f9bd46a..35fc4caa 100644 --- a/ts/structs/DataLossProtect.ts +++ b/ts/structs/DataLossProtect.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_your_last_per_commitment_secret(Uint8Array val) { - bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, val); + bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_my_current_per_commitment_point() { @@ -33,16 +33,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_my_current_per_commitment_point(Uint8Array val) { - bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, val); + bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public static DataLossProtect constructor_new(Uint8Array your_last_per_commitment_secret_arg, Uint8Array my_current_per_commitment_point_arg) { - number ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg); + number ret = bindings.DataLossProtect_new(InternalUtils.check_arr_len(your_last_per_commitment_secret_arg, 32), InternalUtils.check_arr_len(my_current_per_commitment_point_arg, 33)); const ret_hu_conv: DataLossProtect = new DataLossProtect(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.DataLossProtect_clone_ptr(this.ptr); + return ret; + } + public DataLossProtect clone() { number ret = bindings.DataLossProtect_clone(this.ptr); const ret_hu_conv: DataLossProtect = new DataLossProtect(null, ret); diff --git a/ts/structs/DecodeError.ts b/ts/structs/DecodeError.ts index 750447a8..caffcab4 100644 --- a/ts/structs/DecodeError.ts +++ b/ts/structs/DecodeError.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.DecodeError_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.DecodeError_clone_ptr(this.ptr); + return ret; + } + public DecodeError clone() { number ret = bindings.DecodeError_clone(this.ptr); const ret_hu_conv: DecodeError = new DecodeError(null, ret); diff --git a/ts/structs/DelayedPaymentOutputDescriptor.ts b/ts/structs/DelayedPaymentOutputDescriptor.ts index b89922e8..669ad3d0 100644 --- a/ts/structs/DelayedPaymentOutputDescriptor.ts +++ b/ts/structs/DelayedPaymentOutputDescriptor.ts @@ -35,7 +35,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_per_commitment_point(Uint8Array val) { - bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, val); + bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public number get_to_self_delay() { @@ -57,7 +57,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_revocation_pubkey(Uint8Array val) { - bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val); + bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_channel_keys_id() { @@ -66,7 +66,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_keys_id(Uint8Array val) { - bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val); + bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_channel_value_satoshis() { @@ -79,12 +79,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static DelayedPaymentOutputDescriptor constructor_new(OutPoint outpoint_arg, Uint8Array per_commitment_point_arg, number to_self_delay_arg, TxOut output_arg, Uint8Array revocation_pubkey_arg, Uint8Array channel_keys_id_arg, number channel_value_satoshis_arg) { - number ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, per_commitment_point_arg, to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg, channel_keys_id_arg, channel_value_satoshis_arg); + number ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, InternalUtils.check_arr_len(per_commitment_point_arg, 33), to_self_delay_arg, output_arg.ptr, InternalUtils.check_arr_len(revocation_pubkey_arg, 33), InternalUtils.check_arr_len(channel_keys_id_arg, 32), channel_value_satoshis_arg); const ret_hu_conv: DelayedPaymentOutputDescriptor = new DelayedPaymentOutputDescriptor(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.DelayedPaymentOutputDescriptor_clone_ptr(this.ptr); + return ret; + } + public DelayedPaymentOutputDescriptor clone() { number ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr); const ret_hu_conv: DelayedPaymentOutputDescriptor = new DelayedPaymentOutputDescriptor(null, ret); diff --git a/ts/structs/Description.ts b/ts/structs/Description.ts index db55f33b..3fcb336d 100644 --- a/ts/structs/Description.ts +++ b/ts/structs/Description.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.Description_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.Description_clone_ptr(this.ptr); + return ret; + } + public Description clone() { number ret = bindings.Description_clone(this.ptr); const ret_hu_conv: Description = new Description(null, ret); diff --git a/ts/structs/DirectionalChannelInfo.ts b/ts/structs/DirectionalChannelInfo.ts index f0148649..d76b77f5 100644 --- a/ts/structs/DirectionalChannelInfo.ts +++ b/ts/structs/DirectionalChannelInfo.ts @@ -94,6 +94,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.DirectionalChannelInfo_clone_ptr(this.ptr); + return ret; + } + public DirectionalChannelInfo clone() { number ret = bindings.DirectionalChannelInfo_clone(this.ptr); const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); diff --git a/ts/structs/ErrorAction.ts b/ts/structs/ErrorAction.ts index a2f28ba8..ff12a1de 100644 --- a/ts/structs/ErrorAction.ts +++ b/ts/structs/ErrorAction.ts @@ -58,6 +58,11 @@ export class SendErrorMessage extends ErrorAction { 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); diff --git a/ts/structs/ErrorMessage.ts b/ts/structs/ErrorMessage.ts index e85c775b..755f7122 100644 --- a/ts/structs/ErrorMessage.ts +++ b/ts/structs/ErrorMessage.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.ErrorMessage_set_channel_id(this.ptr, val); + bindings.ErrorMessage_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public String get_data() { @@ -37,12 +37,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ErrorMessage constructor_new(Uint8Array channel_id_arg, String data_arg) { - number ret = bindings.ErrorMessage_new(channel_id_arg, data_arg); + number ret = bindings.ErrorMessage_new(InternalUtils.check_arr_len(channel_id_arg, 32), data_arg); const ret_hu_conv: ErrorMessage = new ErrorMessage(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ErrorMessage_clone_ptr(this.ptr); + return ret; + } + public ErrorMessage clone() { number ret = bindings.ErrorMessage_clone(this.ptr); const ret_hu_conv: ErrorMessage = new ErrorMessage(null, ret); diff --git a/ts/structs/Event.ts b/ts/structs/Event.ts index 36a548c8..022a0b5c 100644 --- a/ts/structs/Event.ts +++ b/ts/structs/Event.ts @@ -179,6 +179,11 @@ export class DiscardFunding extends Event { this.transaction = obj.transaction; } } + public number clone_ptr() { + number ret = bindings.Event_clone_ptr(this.ptr); + return ret; + } + public Event clone() { number ret = bindings.Event_clone(this.ptr); Event ret_hu_conv = Event.constr_from_ptr(ret); @@ -187,28 +192,28 @@ export class DiscardFunding extends Event { } public static Event constructor_funding_generation_ready(Uint8Array temporary_channel_id, number channel_value_satoshis, Uint8Array output_script, number user_channel_id) { - number ret = bindings.Event_funding_generation_ready(temporary_channel_id, channel_value_satoshis, output_script, user_channel_id); + number ret = bindings.Event_funding_generation_ready(InternalUtils.check_arr_len(temporary_channel_id, 32), channel_value_satoshis, output_script, user_channel_id); Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static Event constructor_payment_received(Uint8Array payment_hash, number amt, PaymentPurpose purpose) { - number ret = bindings.Event_payment_received(payment_hash, amt, purpose.ptr); + number ret = bindings.Event_payment_received(InternalUtils.check_arr_len(payment_hash, 32), amt, purpose.ptr); Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static Event constructor_payment_sent(Uint8Array payment_id, Uint8Array payment_preimage, Uint8Array payment_hash, Option_u64Z fee_paid_msat) { - number ret = bindings.Event_payment_sent(payment_id, payment_preimage, payment_hash, fee_paid_msat.ptr); + number ret = bindings.Event_payment_sent(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_hash, 32), fee_paid_msat.ptr); Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static Event constructor_payment_path_failed(Uint8Array payment_id, Uint8Array payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) { - number ret = bindings.Event_payment_path_failed(payment_id, payment_hash, rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).map(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray(number[]::new) : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1); + number ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).map(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray(number[]::new) : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1); Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; @@ -236,14 +241,14 @@ export class DiscardFunding extends Event { } public static Event constructor_channel_closed(Uint8Array channel_id, number user_channel_id, ClosureReason reason) { - number ret = bindings.Event_channel_closed(channel_id, user_channel_id, reason.ptr); + number ret = bindings.Event_channel_closed(InternalUtils.check_arr_len(channel_id, 32), user_channel_id, reason.ptr); Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static Event constructor_discard_funding(Uint8Array channel_id, Uint8Array transaction) { - number ret = bindings.Event_discard_funding(channel_id, transaction); + number ret = bindings.Event_discard_funding(InternalUtils.check_arr_len(channel_id, 32), transaction); Event ret_hu_conv = Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/ExpiryTime.ts b/ts/structs/ExpiryTime.ts index 90390158..47b32107 100644 --- a/ts/structs/ExpiryTime.ts +++ b/ts/structs/ExpiryTime.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ExpiryTime_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.ExpiryTime_clone_ptr(this.ptr); + return ret; + } + public ExpiryTime clone() { number ret = bindings.ExpiryTime_clone(this.ptr); const ret_hu_conv: ExpiryTime = new ExpiryTime(null, ret); diff --git a/ts/structs/Fallback.ts b/ts/structs/Fallback.ts index 046b1440..31845b13 100644 --- a/ts/structs/Fallback.ts +++ b/ts/structs/Fallback.ts @@ -48,6 +48,11 @@ export class ScriptHash extends Fallback { this.script_hash = obj.script_hash; } } + public number clone_ptr() { + number ret = bindings.Fallback_clone_ptr(this.ptr); + return ret; + } + public Fallback clone() { number ret = bindings.Fallback_clone(this.ptr); Fallback ret_hu_conv = Fallback.constr_from_ptr(ret); @@ -63,14 +68,14 @@ export class ScriptHash extends Fallback { } public static Fallback constructor_pub_key_hash(Uint8Array a) { - number ret = bindings.Fallback_pub_key_hash(a); + number ret = bindings.Fallback_pub_key_hash(InternalUtils.check_arr_len(a, 20)); Fallback ret_hu_conv = Fallback.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static Fallback constructor_script_hash(Uint8Array a) { - number ret = bindings.Fallback_script_hash(a); + number ret = bindings.Fallback_script_hash(InternalUtils.check_arr_len(a, 20)); Fallback ret_hu_conv = Fallback.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/Filter.ts b/ts/structs/Filter.ts index ca6e7b2e..140d9500 100644 --- a/ts/structs/Filter.ts +++ b/ts/structs/Filter.ts @@ -40,7 +40,7 @@ import * as bindings from '../bindings' // TODO: figure out location const output_hu_conv: WatchedOutput = new WatchedOutput(null, output); output_hu_conv.ptrs_to.add(this); Option_C2Tuple_usizeTransactionZZ ret = arg.register_output(output_hu_conv); - result: number = ret.ptr; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -60,7 +60,7 @@ import * as bindings from '../bindings' // TODO: figure out location held: Filter; } public void register_tx(Uint8Array txid, Uint8Array script_pubkey) { - bindings.Filter_register_tx(this.ptr, txid, script_pubkey); + bindings.Filter_register_tx(this.ptr, InternalUtils.check_arr_len(txid, 32), script_pubkey); } public Option_C2Tuple_usizeTransactionZZ register_output(WatchedOutput output) { diff --git a/ts/structs/FundingCreated.ts b/ts/structs/FundingCreated.ts index a04f0781..6dd59364 100644 --- a/ts/structs/FundingCreated.ts +++ b/ts/structs/FundingCreated.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_temporary_channel_id(Uint8Array val) { - bindings.FundingCreated_set_temporary_channel_id(this.ptr, val); + bindings.FundingCreated_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_funding_txid() { @@ -33,7 +33,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_funding_txid(Uint8Array val) { - bindings.FundingCreated_set_funding_txid(this.ptr, val); + bindings.FundingCreated_set_funding_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_funding_output_index() { @@ -51,16 +51,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_signature(Uint8Array val) { - bindings.FundingCreated_set_signature(this.ptr, val); + bindings.FundingCreated_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public static FundingCreated constructor_new(Uint8Array temporary_channel_id_arg, Uint8Array funding_txid_arg, number funding_output_index_arg, Uint8Array signature_arg) { - number ret = bindings.FundingCreated_new(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg); + number ret = bindings.FundingCreated_new(InternalUtils.check_arr_len(temporary_channel_id_arg, 32), InternalUtils.check_arr_len(funding_txid_arg, 32), funding_output_index_arg, InternalUtils.check_arr_len(signature_arg, 64)); const ret_hu_conv: FundingCreated = new FundingCreated(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.FundingCreated_clone_ptr(this.ptr); + return ret; + } + public FundingCreated clone() { number ret = bindings.FundingCreated_clone(this.ptr); const ret_hu_conv: FundingCreated = new FundingCreated(null, ret); diff --git a/ts/structs/FundingLocked.ts b/ts/structs/FundingLocked.ts index e03acf3e..e6201012 100644 --- a/ts/structs/FundingLocked.ts +++ b/ts/structs/FundingLocked.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.FundingLocked_set_channel_id(this.ptr, val); + bindings.FundingLocked_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_next_per_commitment_point() { @@ -33,16 +33,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_next_per_commitment_point(Uint8Array val) { - bindings.FundingLocked_set_next_per_commitment_point(this.ptr, val); + bindings.FundingLocked_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public static FundingLocked constructor_new(Uint8Array channel_id_arg, Uint8Array next_per_commitment_point_arg) { - number ret = bindings.FundingLocked_new(channel_id_arg, next_per_commitment_point_arg); + number ret = bindings.FundingLocked_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33)); const ret_hu_conv: FundingLocked = new FundingLocked(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.FundingLocked_clone_ptr(this.ptr); + return ret; + } + public FundingLocked clone() { number ret = bindings.FundingLocked_clone(this.ptr); const ret_hu_conv: FundingLocked = new FundingLocked(null, ret); diff --git a/ts/structs/FundingSigned.ts b/ts/structs/FundingSigned.ts index a0271f1a..f9380e7f 100644 --- a/ts/structs/FundingSigned.ts +++ b/ts/structs/FundingSigned.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.FundingSigned_set_channel_id(this.ptr, val); + bindings.FundingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_signature() { @@ -33,16 +33,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_signature(Uint8Array val) { - bindings.FundingSigned_set_signature(this.ptr, val); + bindings.FundingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public static FundingSigned constructor_new(Uint8Array channel_id_arg, Uint8Array signature_arg) { - number ret = bindings.FundingSigned_new(channel_id_arg, signature_arg); + number ret = bindings.FundingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64)); const ret_hu_conv: FundingSigned = new FundingSigned(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.FundingSigned_clone_ptr(this.ptr); + return ret; + } + public FundingSigned clone() { number ret = bindings.FundingSigned_clone(this.ptr); const ret_hu_conv: FundingSigned = new FundingSigned(null, ret); diff --git a/ts/structs/GossipTimestampFilter.ts b/ts/structs/GossipTimestampFilter.ts index 8ef06f40..2d1e9aec 100644 --- a/ts/structs/GossipTimestampFilter.ts +++ b/ts/structs/GossipTimestampFilter.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_chain_hash(Uint8Array val) { - bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val); + bindings.GossipTimestampFilter_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_first_timestamp() { @@ -46,12 +46,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static GossipTimestampFilter constructor_new(Uint8Array chain_hash_arg, number first_timestamp_arg, number timestamp_range_arg) { - number ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg); + number ret = bindings.GossipTimestampFilter_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_timestamp_arg, timestamp_range_arg); const ret_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.GossipTimestampFilter_clone_ptr(this.ptr); + return ret; + } + public GossipTimestampFilter clone() { number ret = bindings.GossipTimestampFilter_clone(this.ptr); const ret_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, ret); diff --git a/ts/structs/HTLCOutputInCommitment.ts b/ts/structs/HTLCOutputInCommitment.ts index 2f0e42b1..3b93a6a7 100644 --- a/ts/structs/HTLCOutputInCommitment.ts +++ b/ts/structs/HTLCOutputInCommitment.ts @@ -51,7 +51,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_hash(Uint8Array val) { - bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); + bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Option_u32Z get_transaction_output_index() { @@ -66,12 +66,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static HTLCOutputInCommitment constructor_new(boolean offered_arg, number amount_msat_arg, number cltv_expiry_arg, Uint8Array payment_hash_arg, Option_u32Z transaction_output_index_arg) { - number ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg, transaction_output_index_arg.ptr); + number ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, InternalUtils.check_arr_len(payment_hash_arg, 32), transaction_output_index_arg.ptr); const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.HTLCOutputInCommitment_clone_ptr(this.ptr); + return ret; + } + public HTLCOutputInCommitment clone() { number ret = bindings.HTLCOutputInCommitment_clone(this.ptr); const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); diff --git a/ts/structs/HTLCUpdate.ts b/ts/structs/HTLCUpdate.ts index 3eaef553..23f9d9a3 100644 --- a/ts/structs/HTLCUpdate.ts +++ b/ts/structs/HTLCUpdate.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.HTLCUpdate_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.HTLCUpdate_clone_ptr(this.ptr); + return ret; + } + public HTLCUpdate clone() { number ret = bindings.HTLCUpdate_clone(this.ptr); const ret_hu_conv: HTLCUpdate = new HTLCUpdate(null, ret); diff --git a/ts/structs/HolderCommitmentTransaction.ts b/ts/structs/HolderCommitmentTransaction.ts index 1a071a70..1ece40cf 100644 --- a/ts/structs/HolderCommitmentTransaction.ts +++ b/ts/structs/HolderCommitmentTransaction.ts @@ -24,11 +24,16 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_counterparty_sig(Uint8Array val) { - bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, val); + bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, InternalUtils.check_arr_len(val, 64)); } public void set_counterparty_htlc_sigs(Uint8Array[] val) { - bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val); + bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> InternalUtils.check_arr_len(val_conv_12, 64)).toArray(Uint8Array[]::new) : null); + } + + public number clone_ptr() { + number ret = bindings.HolderCommitmentTransaction_clone_ptr(this.ptr); + return ret; } public HolderCommitmentTransaction clone() { @@ -50,7 +55,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static HolderCommitmentTransaction constructor_new(CommitmentTransaction commitment_tx, Uint8Array counterparty_sig, Uint8Array[] counterparty_htlc_sigs, Uint8Array holder_funding_key, Uint8Array counterparty_funding_key) { - number ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key); + number ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, InternalUtils.check_arr_len(counterparty_sig, 64), counterparty_htlc_sigs != null ? Arrays.stream(counterparty_htlc_sigs).map(counterparty_htlc_sigs_conv_12 -> InternalUtils.check_arr_len(counterparty_htlc_sigs_conv_12, 64)).toArray(Uint8Array[]::new) : null, InternalUtils.check_arr_len(holder_funding_key, 33), InternalUtils.check_arr_len(counterparty_funding_key, 33)); const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/InMemorySigner.ts b/ts/structs/InMemorySigner.ts index 7df31aa9..767957f2 100644 --- a/ts/structs/InMemorySigner.ts +++ b/ts/structs/InMemorySigner.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_funding_key(Uint8Array val) { - bindings.InMemorySigner_set_funding_key(this.ptr, val); + bindings.InMemorySigner_set_funding_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_revocation_base_key() { @@ -33,7 +33,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_revocation_base_key(Uint8Array val) { - bindings.InMemorySigner_set_revocation_base_key(this.ptr, val); + bindings.InMemorySigner_set_revocation_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_payment_key() { @@ -42,7 +42,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_key(Uint8Array val) { - bindings.InMemorySigner_set_payment_key(this.ptr, val); + bindings.InMemorySigner_set_payment_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_delayed_payment_base_key() { @@ -51,7 +51,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_delayed_payment_base_key(Uint8Array val) { - bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, val); + bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_htlc_base_key() { @@ -60,7 +60,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_htlc_base_key(Uint8Array val) { - bindings.InMemorySigner_set_htlc_base_key(this.ptr, val); + bindings.InMemorySigner_set_htlc_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_commitment_seed() { @@ -69,7 +69,12 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_commitment_seed(Uint8Array val) { - bindings.InMemorySigner_set_commitment_seed(this.ptr, val); + bindings.InMemorySigner_set_commitment_seed(this.ptr, InternalUtils.check_arr_len(val, 32)); + } + + public number clone_ptr() { + number ret = bindings.InMemorySigner_clone_ptr(this.ptr); + return ret; } public InMemorySigner clone() { @@ -80,7 +85,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static InMemorySigner constructor_new(Uint8Array funding_key, Uint8Array revocation_base_key, Uint8Array payment_key, Uint8Array delayed_payment_base_key, Uint8Array htlc_base_key, Uint8Array commitment_seed, number channel_value_satoshis, Uint8Array channel_keys_id) { - number ret = bindings.InMemorySigner_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, channel_keys_id); + number ret = bindings.InMemorySigner_new(InternalUtils.check_arr_len(funding_key, 32), InternalUtils.check_arr_len(revocation_base_key, 32), InternalUtils.check_arr_len(payment_key, 32), InternalUtils.check_arr_len(delayed_payment_base_key, 32), InternalUtils.check_arr_len(htlc_base_key, 32), InternalUtils.check_arr_len(commitment_seed, 32), channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32)); const ret_hu_conv: InMemorySigner = new InMemorySigner(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/Init.ts b/ts/structs/Init.ts index 9b127bfc..94cd5d87 100644 --- a/ts/structs/Init.ts +++ b/ts/structs/Init.ts @@ -36,6 +36,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.Init_clone_ptr(this.ptr); + return ret; + } + public Init clone() { number ret = bindings.Init_clone(this.ptr); const ret_hu_conv: Init = new Init(null, ret); diff --git a/ts/structs/InitFeatures.ts b/ts/structs/InitFeatures.ts index 4f18b363..387c4a30 100644 --- a/ts/structs/InitFeatures.ts +++ b/ts/structs/InitFeatures.ts @@ -24,6 +24,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.InitFeatures_clone_ptr(this.ptr); + return ret; + } + public InitFeatures clone() { number ret = bindings.InitFeatures_clone(this.ptr); const ret_hu_conv: InitFeatures = new InitFeatures(null, ret); diff --git a/ts/structs/InvalidShutdownScript.ts b/ts/structs/InvalidShutdownScript.ts index 57d7b907..0f5a990f 100644 --- a/ts/structs/InvalidShutdownScript.ts +++ b/ts/structs/InvalidShutdownScript.ts @@ -34,6 +34,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.InvalidShutdownScript_clone_ptr(this.ptr); + return ret; + } + public InvalidShutdownScript clone() { number ret = bindings.InvalidShutdownScript_clone(this.ptr); const ret_hu_conv: InvalidShutdownScript = new InvalidShutdownScript(null, ret); diff --git a/ts/structs/Invoice.ts b/ts/structs/Invoice.ts index d5fa849d..aa559f5a 100644 --- a/ts/structs/Invoice.ts +++ b/ts/structs/Invoice.ts @@ -24,6 +24,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.Invoice_clone_ptr(this.ptr); + return ret; + } + public Invoice clone() { number ret = bindings.Invoice_clone(this.ptr); const ret_hu_conv: Invoice = new Invoice(null, ret); diff --git a/ts/structs/InvoiceFeatures.ts b/ts/structs/InvoiceFeatures.ts index e68a62c1..109957b1 100644 --- a/ts/structs/InvoiceFeatures.ts +++ b/ts/structs/InvoiceFeatures.ts @@ -24,6 +24,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.InvoiceFeatures_clone_ptr(this.ptr); + return ret; + } + public InvoiceFeatures clone() { number ret = bindings.InvoiceFeatures_clone(this.ptr); const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret); diff --git a/ts/structs/InvoicePayer.ts b/ts/structs/InvoicePayer.ts index f76849f8..fcccc6c8 100644 --- a/ts/structs/InvoicePayer.ts +++ b/ts/structs/InvoicePayer.ts @@ -45,7 +45,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void remove_cached_payment(Uint8Array payment_hash) { - bindings.InvoicePayer_remove_cached_payment(this.ptr, payment_hash); + bindings.InvoicePayer_remove_cached_payment(this.ptr, InternalUtils.check_arr_len(payment_hash, 32)); } public EventHandler as_EventHandler() { diff --git a/ts/structs/InvoiceSignature.ts b/ts/structs/InvoiceSignature.ts index f533e27d..55643a49 100644 --- a/ts/structs/InvoiceSignature.ts +++ b/ts/structs/InvoiceSignature.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.InvoiceSignature_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.InvoiceSignature_clone_ptr(this.ptr); + return ret; + } + public InvoiceSignature clone() { number ret = bindings.InvoiceSignature_clone(this.ptr); const ret_hu_conv: InvoiceSignature = new InvoiceSignature(null, ret); diff --git a/ts/structs/KeysInterface.ts b/ts/structs/KeysInterface.ts index 7f48672c..46543e46 100644 --- a/ts/structs/KeysInterface.ts +++ b/ts/structs/KeysInterface.ts @@ -34,7 +34,8 @@ import * as bindings from '../bindings' // TODO: figure out location // todo: in-line interface filling get_node_secret (): Uint8Array { Uint8Array ret = arg.get_node_secret(); - return ret; + result: Uint8Array = InternalUtils.check_arr_len(ret, 32); + return result; }, get_destination_script (): Uint8Array { @@ -44,31 +45,32 @@ import * as bindings from '../bindings' // TODO: figure out location get_shutdown_scriptpubkey (): number { ShutdownScript ret = arg.get_shutdown_scriptpubkey(); - result: number = ret == null ? 0 : ret.ptr & ~1; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, get_channel_signer (inbound: boolean, channel_value_satoshis: number): number { Sign ret = arg.get_channel_signer(inbound, channel_value_satoshis); - result: number = ret == null ? 0 : ret.ptr; + result: number = ret == null ? 0 : ret.clone_ptr(); impl_holder.held.ptrs_to.add(ret); return result; }, get_secure_random_bytes (): Uint8Array { Uint8Array ret = arg.get_secure_random_bytes(); - return ret; + result: Uint8Array = InternalUtils.check_arr_len(ret, 32); + return result; }, read_chan_signer (reader: Uint8Array): number { Result_SignDecodeErrorZ ret = arg.read_chan_signer(reader); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, sign_invoice (invoice_preimage: Uint8Array): number { Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(invoice_preimage); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, diff --git a/ts/structs/KeysManager.ts b/ts/structs/KeysManager.ts index 96626d24..75ab015f 100644 --- a/ts/structs/KeysManager.ts +++ b/ts/structs/KeysManager.ts @@ -19,14 +19,14 @@ import * as bindings from '../bindings' // TODO: figure out location } } public static KeysManager constructor_new(Uint8Array seed, number starting_time_secs, number starting_time_nanos) { - number ret = bindings.KeysManager_new(seed, starting_time_secs, starting_time_nanos); + number ret = bindings.KeysManager_new(InternalUtils.check_arr_len(seed, 32), starting_time_secs, starting_time_nanos); const ret_hu_conv: KeysManager = new KeysManager(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public InMemorySigner derive_channel_keys(number channel_value_satoshis, Uint8Array params) { - number ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params); + number ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(params, 32)); const ret_hu_conv: InMemorySigner = new InMemorySigner(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; diff --git a/ts/structs/LightningError.ts b/ts/structs/LightningError.ts index 02b894ca..3cdedccc 100644 --- a/ts/structs/LightningError.ts +++ b/ts/structs/LightningError.ts @@ -45,6 +45,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.LightningError_clone_ptr(this.ptr); + return ret; + } + public LightningError clone() { number ret = bindings.LightningError_clone(this.ptr); const ret_hu_conv: LightningError = new LightningError(null, ret); diff --git a/ts/structs/Listen.ts b/ts/structs/Listen.ts index 9e6ad6f9..15154c4f 100644 --- a/ts/structs/Listen.ts +++ b/ts/structs/Listen.ts @@ -60,7 +60,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void block_disconnected(Uint8Array header, number height) { - bindings.Listen_block_disconnected(this.ptr, header, height); + bindings.Listen_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height); } } diff --git a/ts/structs/Logger.ts b/ts/structs/Logger.ts index e70ca9bc..ffe8b3a5 100644 --- a/ts/structs/Logger.ts +++ b/ts/structs/Logger.ts @@ -32,8 +32,9 @@ import * as bindings from '../bindings' // TODO: figure out location const impl_holder: LDKLoggerHolder = new LDKLoggerHolder(); let structImplementation = { // todo: in-line interface filling - log (record: String): void { - arg.log(record); + log (record: number): void { + const record_hu_conv: Record = new Record(null, record); + arg.log(record_hu_conv); }, @@ -43,7 +44,7 @@ import * as bindings from '../bindings' // TODO: figure out location } export interface LoggerInterface { - log(record: String): void; + log(record: Record): void; } diff --git a/ts/structs/MessageSendEvent.ts b/ts/structs/MessageSendEvent.ts index 682d5556..c02e9e37 100644 --- a/ts/structs/MessageSendEvent.ts +++ b/ts/structs/MessageSendEvent.ts @@ -298,6 +298,11 @@ export class SendReplyChannelRange extends MessageSendEvent { this.msg = msg_hu_conv; } } + public number clone_ptr() { + number ret = bindings.MessageSendEvent_clone_ptr(this.ptr); + return ret; + } + public MessageSendEvent clone() { number ret = bindings.MessageSendEvent_clone(this.ptr); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); @@ -306,77 +311,77 @@ export class SendReplyChannelRange extends MessageSendEvent { } public static MessageSendEvent constructor_send_accept_channel(Uint8Array node_id, AcceptChannel msg) { - number ret = bindings.MessageSendEvent_send_accept_channel(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_open_channel(Uint8Array node_id, OpenChannel msg) { - number ret = bindings.MessageSendEvent_send_open_channel(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_funding_created(Uint8Array node_id, FundingCreated msg) { - number ret = bindings.MessageSendEvent_send_funding_created(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_funding_signed(Uint8Array node_id, FundingSigned msg) { - number ret = bindings.MessageSendEvent_send_funding_signed(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_funding_locked(Uint8Array node_id, FundingLocked msg) { - number ret = bindings.MessageSendEvent_send_funding_locked(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_funding_locked(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_announcement_signatures(Uint8Array node_id, AnnouncementSignatures msg) { - number ret = bindings.MessageSendEvent_send_announcement_signatures(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_update_htlcs(Uint8Array node_id, CommitmentUpdate updates) { - number ret = bindings.MessageSendEvent_update_htlcs(node_id, updates == null ? 0 : updates.ptr & ~1); + number ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_revoke_and_ack(Uint8Array node_id, RevokeAndACK msg) { - number ret = bindings.MessageSendEvent_send_revoke_and_ack(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_closing_signed(Uint8Array node_id, ClosingSigned msg) { - number ret = bindings.MessageSendEvent_send_closing_signed(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_shutdown(Uint8Array node_id, Shutdown msg) { - number ret = bindings.MessageSendEvent_send_shutdown(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_channel_reestablish(Uint8Array node_id, ChannelReestablish msg) { - number ret = bindings.MessageSendEvent_send_channel_reestablish(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; @@ -404,35 +409,35 @@ export class SendReplyChannelRange extends MessageSendEvent { } public static MessageSendEvent constructor_send_channel_update(Uint8Array node_id, ChannelUpdate msg) { - number ret = bindings.MessageSendEvent_send_channel_update(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_handle_error(Uint8Array node_id, ErrorAction action) { - number ret = bindings.MessageSendEvent_handle_error(node_id, action.ptr); + number ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_channel_range_query(Uint8Array node_id, QueryChannelRange msg) { - number ret = bindings.MessageSendEvent_send_channel_range_query(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_short_ids_query(Uint8Array node_id, QueryShortChannelIds msg) { - number ret = bindings.MessageSendEvent_send_short_ids_query(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static MessageSendEvent constructor_send_reply_channel_range(Uint8Array node_id, ReplyChannelRange msg) { - number ret = bindings.MessageSendEvent_send_reply_channel_range(node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/MessageSendEventsProvider.ts b/ts/structs/MessageSendEventsProvider.ts index fb52212a..d4cb29a3 100644 --- a/ts/structs/MessageSendEventsProvider.ts +++ b/ts/structs/MessageSendEventsProvider.ts @@ -34,7 +34,7 @@ import * as bindings from '../bindings' // TODO: figure out location // todo: in-line interface filling get_and_clear_pending_msg_events (): number[] { MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events(); - result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18.ptr).toArray(number[]::new) : null; + result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.clone_ptr()).toArray(number[]::new) : null; return result; }, diff --git a/ts/structs/MinFinalCltvExpiry.ts b/ts/structs/MinFinalCltvExpiry.ts index 28511146..709b1788 100644 --- a/ts/structs/MinFinalCltvExpiry.ts +++ b/ts/structs/MinFinalCltvExpiry.ts @@ -34,6 +34,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.MinFinalCltvExpiry_clone_ptr(this.ptr); + return ret; + } + public MinFinalCltvExpiry clone() { number ret = bindings.MinFinalCltvExpiry_clone(this.ptr); const ret_hu_conv: MinFinalCltvExpiry = new MinFinalCltvExpiry(null, ret); diff --git a/ts/structs/MonitorEvent.ts b/ts/structs/MonitorEvent.ts index 121b5025..40899fe8 100644 --- a/ts/structs/MonitorEvent.ts +++ b/ts/structs/MonitorEvent.ts @@ -68,6 +68,11 @@ export class UpdateFailed extends MonitorEvent { this.update_failed = update_failed_hu_conv; } } + public number clone_ptr() { + number ret = bindings.MonitorEvent_clone_ptr(this.ptr); + return ret; + } + public MonitorEvent clone() { number ret = bindings.MonitorEvent_clone(this.ptr); MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret); diff --git a/ts/structs/MonitorUpdateError.ts b/ts/structs/MonitorUpdateError.ts index d76621ad..662021c1 100644 --- a/ts/structs/MonitorUpdateError.ts +++ b/ts/structs/MonitorUpdateError.ts @@ -34,6 +34,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.MonitorUpdateError_clone_ptr(this.ptr); + return ret; + } + public MonitorUpdateError clone() { number ret = bindings.MonitorUpdateError_clone(this.ptr); const ret_hu_conv: MonitorUpdateError = new MonitorUpdateError(null, ret); diff --git a/ts/structs/MonitorUpdateId.ts b/ts/structs/MonitorUpdateId.ts index 9a792bef..d9e6d3e5 100644 --- a/ts/structs/MonitorUpdateId.ts +++ b/ts/structs/MonitorUpdateId.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.MonitorUpdateId_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.MonitorUpdateId_clone_ptr(this.ptr); + return ret; + } + public MonitorUpdateId clone() { number ret = bindings.MonitorUpdateId_clone(this.ptr); const ret_hu_conv: MonitorUpdateId = new MonitorUpdateId(null, ret); diff --git a/ts/structs/NetAddress.ts b/ts/structs/NetAddress.ts index 0c93f092..2910201a 100644 --- a/ts/structs/NetAddress.ts +++ b/ts/structs/NetAddress.ts @@ -66,6 +66,11 @@ export class OnionV3 extends NetAddress { this.port = obj.port; } } + public number clone_ptr() { + number ret = bindings.NetAddress_clone_ptr(this.ptr); + return ret; + } + public NetAddress clone() { number ret = bindings.NetAddress_clone(this.ptr); NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); @@ -74,28 +79,28 @@ export class OnionV3 extends NetAddress { } public static NetAddress constructor_ipv4(Uint8Array addr, number port) { - number ret = bindings.NetAddress_ipv4(addr, port); + number ret = bindings.NetAddress_ipv4(InternalUtils.check_arr_len(addr, 4), port); NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static NetAddress constructor_ipv6(Uint8Array addr, number port) { - number ret = bindings.NetAddress_ipv6(addr, port); + number ret = bindings.NetAddress_ipv6(InternalUtils.check_arr_len(addr, 16), port); NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static NetAddress constructor_onion_v2(Uint8Array addr, number port) { - number ret = bindings.NetAddress_onion_v2(addr, port); + number ret = bindings.NetAddress_onion_v2(InternalUtils.check_arr_len(addr, 10), port); NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static NetAddress constructor_onion_v3(Uint8Array ed25519_pubkey, number checksum, number version, number port) { - number ret = bindings.NetAddress_onion_v3(ed25519_pubkey, checksum, version, port); + number ret = bindings.NetAddress_onion_v3(InternalUtils.check_arr_len(ed25519_pubkey, 32), checksum, version, port); NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/NetGraphMsgHandler.ts b/ts/structs/NetGraphMsgHandler.ts index b4dbb87b..ee9659a8 100644 --- a/ts/structs/NetGraphMsgHandler.ts +++ b/ts/structs/NetGraphMsgHandler.ts @@ -30,12 +30,14 @@ import * as bindings from '../bindings' // TODO: figure out location const ret_hu_conv: NetGraphMsgHandler = new NetGraphMsgHandler(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(network_graph); + ret_hu_conv.ptrs_to.add(chain_access); ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } public void add_chain_access(Option_AccessZ chain_access) { bindings.NetGraphMsgHandler_add_chain_access(this.ptr, chain_access.ptr); + this.ptrs_to.add(chain_access); } public RoutingMessageHandler as_RoutingMessageHandler() { diff --git a/ts/structs/NetworkGraph.ts b/ts/structs/NetworkGraph.ts index 2d96e4c0..e2c2a6f8 100644 --- a/ts/structs/NetworkGraph.ts +++ b/ts/structs/NetworkGraph.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.NetworkGraph_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.NetworkGraph_clone_ptr(this.ptr); + return ret; + } + public NetworkGraph clone() { number ret = bindings.NetworkGraph_clone(this.ptr); const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret); @@ -37,7 +42,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static NetworkGraph constructor_new(Uint8Array genesis_hash) { - number ret = bindings.NetworkGraph_new(genesis_hash); + number ret = bindings.NetworkGraph_new(InternalUtils.check_arr_len(genesis_hash, 32)); const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; @@ -68,6 +73,7 @@ import * as bindings from '../bindings' // TODO: figure out location number ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access.ptr); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); + this.ptrs_to.add(chain_access); return ret_hu_conv; } @@ -75,6 +81,7 @@ import * as bindings from '../bindings' // TODO: figure out location number ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access.ptr); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); + this.ptrs_to.add(chain_access); return ret_hu_conv; } @@ -83,7 +90,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void fail_node(Uint8Array _node_id, boolean is_permanent) { - bindings.NetworkGraph_fail_node(this.ptr, _node_id, is_permanent); + bindings.NetworkGraph_fail_node(this.ptr, InternalUtils.check_arr_len(_node_id, 33), is_permanent); } public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) { diff --git a/ts/structs/NetworkUpdate.ts b/ts/structs/NetworkUpdate.ts index 97f9af23..758e2225 100644 --- a/ts/structs/NetworkUpdate.ts +++ b/ts/structs/NetworkUpdate.ts @@ -51,6 +51,11 @@ export class NodeFailure extends NetworkUpdate { this.is_permanent = obj.is_permanent; } } + public number clone_ptr() { + number ret = bindings.NetworkUpdate_clone_ptr(this.ptr); + return ret; + } + public NetworkUpdate clone() { number ret = bindings.NetworkUpdate_clone(this.ptr); NetworkUpdate ret_hu_conv = NetworkUpdate.constr_from_ptr(ret); @@ -73,7 +78,7 @@ export class NodeFailure extends NetworkUpdate { } public static NetworkUpdate constructor_node_failure(Uint8Array node_id, boolean is_permanent) { - number ret = bindings.NetworkUpdate_node_failure(node_id, is_permanent); + number ret = bindings.NetworkUpdate_node_failure(InternalUtils.check_arr_len(node_id, 33), is_permanent); NetworkUpdate ret_hu_conv = NetworkUpdate.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/NodeAnnouncement.ts b/ts/structs/NodeAnnouncement.ts index cef5ecdb..e3087cd1 100644 --- a/ts/structs/NodeAnnouncement.ts +++ b/ts/structs/NodeAnnouncement.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_signature(Uint8Array val) { - bindings.NodeAnnouncement_set_signature(this.ptr, val); + bindings.NodeAnnouncement_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64)); } public UnsignedNodeAnnouncement get_contents() { @@ -39,12 +39,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static NodeAnnouncement constructor_new(Uint8Array signature_arg, UnsignedNodeAnnouncement contents_arg) { - number ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + number ret = bindings.NodeAnnouncement_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1); const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.NodeAnnouncement_clone_ptr(this.ptr); + return ret; + } + public NodeAnnouncement clone() { number ret = bindings.NodeAnnouncement_clone(this.ptr); const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); diff --git a/ts/structs/NodeAnnouncementInfo.ts b/ts/structs/NodeAnnouncementInfo.ts index cd2e6d24..a5cd2286 100644 --- a/ts/structs/NodeAnnouncementInfo.ts +++ b/ts/structs/NodeAnnouncementInfo.ts @@ -44,7 +44,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_rgb(Uint8Array val) { - bindings.NodeAnnouncementInfo_set_rgb(this.ptr, val); + bindings.NodeAnnouncementInfo_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3)); } public Uint8Array get_alias() { @@ -53,7 +53,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_alias(Uint8Array val) { - bindings.NodeAnnouncementInfo_set_alias(this.ptr, val); + bindings.NodeAnnouncementInfo_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32)); } public void set_addresses(NetAddress[] val) { @@ -72,12 +72,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static NodeAnnouncementInfo constructor_new(NodeFeatures features_arg, number last_update_arg, Uint8Array rgb_arg, Uint8Array alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) { - number ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, addresses_arg != null ? Arrays.stream(addresses_arg).map(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(number[]::new) : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); + number ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), InternalUtils.check_arr_len(alias_arg, 32), addresses_arg != null ? Arrays.stream(addresses_arg).map(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(number[]::new) : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.NodeAnnouncementInfo_clone_ptr(this.ptr); + return ret; + } + public NodeAnnouncementInfo clone() { number ret = bindings.NodeAnnouncementInfo_clone(this.ptr); const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret); diff --git a/ts/structs/NodeFeatures.ts b/ts/structs/NodeFeatures.ts index d65e11e3..96f6e286 100644 --- a/ts/structs/NodeFeatures.ts +++ b/ts/structs/NodeFeatures.ts @@ -24,6 +24,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.NodeFeatures_clone_ptr(this.ptr); + return ret; + } + public NodeFeatures clone() { number ret = bindings.NodeFeatures_clone(this.ptr); const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); diff --git a/ts/structs/NodeId.ts b/ts/structs/NodeId.ts index c08e5632..9f288e0a 100644 --- a/ts/structs/NodeId.ts +++ b/ts/structs/NodeId.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.NodeId_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.NodeId_clone_ptr(this.ptr); + return ret; + } + public NodeId clone() { number ret = bindings.NodeId_clone(this.ptr); const ret_hu_conv: NodeId = new NodeId(null, ret); @@ -26,7 +31,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static NodeId constructor_from_pubkey(Uint8Array pubkey) { - number ret = bindings.NodeId_from_pubkey(pubkey); + number ret = bindings.NodeId_from_pubkey(InternalUtils.check_arr_len(pubkey, 33)); const ret_hu_conv: NodeId = new NodeId(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/NodeInfo.ts b/ts/structs/NodeInfo.ts index 810dbcd7..da17e063 100644 --- a/ts/structs/NodeInfo.ts +++ b/ts/structs/NodeInfo.ts @@ -51,6 +51,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.NodeInfo_clone_ptr(this.ptr); + return ret; + } + public NodeInfo clone() { number ret = bindings.NodeInfo_clone(this.ptr); const ret_hu_conv: NodeInfo = new NodeInfo(null, ret); diff --git a/ts/structs/OpenChannel.ts b/ts/structs/OpenChannel.ts index cbdaf307..6a62b836 100644 --- a/ts/structs/OpenChannel.ts +++ b/ts/structs/OpenChannel.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_chain_hash(Uint8Array val) { - bindings.OpenChannel_set_chain_hash(this.ptr, val); + bindings.OpenChannel_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_temporary_channel_id() { @@ -33,7 +33,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_temporary_channel_id(Uint8Array val) { - bindings.OpenChannel_set_temporary_channel_id(this.ptr, val); + bindings.OpenChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_funding_satoshis() { @@ -123,7 +123,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_funding_pubkey(Uint8Array val) { - bindings.OpenChannel_set_funding_pubkey(this.ptr, val); + bindings.OpenChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_revocation_basepoint() { @@ -132,7 +132,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_revocation_basepoint(Uint8Array val) { - bindings.OpenChannel_set_revocation_basepoint(this.ptr, val); + bindings.OpenChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_payment_point() { @@ -141,7 +141,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_point(Uint8Array val) { - bindings.OpenChannel_set_payment_point(this.ptr, val); + bindings.OpenChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_delayed_payment_basepoint() { @@ -150,7 +150,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_delayed_payment_basepoint(Uint8Array val) { - bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, val); + bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_htlc_basepoint() { @@ -159,7 +159,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_htlc_basepoint(Uint8Array val) { - bindings.OpenChannel_set_htlc_basepoint(this.ptr, val); + bindings.OpenChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_first_per_commitment_point() { @@ -168,7 +168,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_first_per_commitment_point(Uint8Array val) { - bindings.OpenChannel_set_first_per_commitment_point(this.ptr, val); + bindings.OpenChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public number get_channel_flags() { @@ -180,6 +180,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.OpenChannel_set_channel_flags(this.ptr, val); } + public number clone_ptr() { + number ret = bindings.OpenChannel_clone_ptr(this.ptr); + return ret; + } + public OpenChannel clone() { number ret = bindings.OpenChannel_clone(this.ptr); const ret_hu_conv: OpenChannel = new OpenChannel(null, ret); diff --git a/ts/structs/Option_C2Tuple_usizeTransactionZZ.ts b/ts/structs/Option_C2Tuple_usizeTransactionZZ.ts index d9de28ad..a3cb7413 100644 --- a/ts/structs/Option_C2Tuple_usizeTransactionZZ.ts +++ b/ts/structs/Option_C2Tuple_usizeTransactionZZ.ts @@ -49,6 +49,11 @@ export class None extends COption_C2Tuple_usizeTransactionZZ { return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone_ptr(this.ptr); + return ret; + } + public Option_C2Tuple_usizeTransactionZZ clone() { number ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone(this.ptr); Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); diff --git a/ts/structs/Option_CVec_NetAddressZZ.ts b/ts/structs/Option_CVec_NetAddressZZ.ts index 2a71cc86..9cbac12c 100644 --- a/ts/structs/Option_CVec_NetAddressZZ.ts +++ b/ts/structs/Option_CVec_NetAddressZZ.ts @@ -54,6 +54,11 @@ export class None extends COption_CVec_NetAddressZZ { return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.COption_CVec_NetAddressZZ_clone_ptr(this.ptr); + return ret; + } + public Option_CVec_NetAddressZZ clone() { number ret = bindings.COption_CVec_NetAddressZZ_clone(this.ptr); Option_CVec_NetAddressZZ ret_hu_conv = Option_CVec_NetAddressZZ.constr_from_ptr(ret); diff --git a/ts/structs/Option_ClosureReasonZ.ts b/ts/structs/Option_ClosureReasonZ.ts new file mode 100644 index 00000000..c77ca357 --- /dev/null +++ b/ts/structs/Option_ClosureReasonZ.ts @@ -0,0 +1,64 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +export default class COption_ClosureReasonZ extends CommonBase { + protected constructor(_dummy: object, ptr: number) { super(ptr); } + protected finalize() { + super.finalize(); + if (this.ptr != 0) { bindings.COption_ClosureReasonZ_free(this.ptr); } + } + static constr_from_ptr(ptr: number): COption_ClosureReasonZ { + const raw_val: bindings.LDKCOption_ClosureReasonZ = bindings.LDKCOption_ClosureReasonZ_ref_from_ptr(ptr); + if (raw_val instanceof bindings.LDKCOption_ClosureReasonZ.Some) { + return new Some(this.ptr, raw_val); + } + if (raw_val instanceof bindings.LDKCOption_ClosureReasonZ.None) { + return new None(this.ptr, raw_val); + } + throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface + } + +} +export class Some extends COption_ClosureReasonZ { + public some: ClosureReason; + private constructor(ptr: number, obj: bindings.LDKCOption_ClosureReasonZ.Some) { + super(null, ptr); + const some: number = obj.some; + ClosureReason some_hu_conv = ClosureReason.constr_from_ptr(some); + some_hu_conv.ptrs_to.add(this); + this.some = some_hu_conv; + } +} +export class None extends COption_ClosureReasonZ { + private constructor(ptr: number, obj: bindings.LDKCOption_ClosureReasonZ.None) { + super(null, ptr); + } +} + public static Option_ClosureReasonZ constructor_some(ClosureReason o) { + number ret = bindings.COption_ClosureReasonZ_some(o.ptr); + Option_ClosureReasonZ ret_hu_conv = Option_ClosureReasonZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static Option_ClosureReasonZ constructor_none() { + number ret = bindings.COption_ClosureReasonZ_none(); + Option_ClosureReasonZ ret_hu_conv = Option_ClosureReasonZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public number clone_ptr() { + number ret = bindings.COption_ClosureReasonZ_clone_ptr(this.ptr); + return ret; + } + + public Option_ClosureReasonZ clone() { + number ret = bindings.COption_ClosureReasonZ_clone(this.ptr); + Option_ClosureReasonZ ret_hu_conv = Option_ClosureReasonZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Option_EventZ.ts b/ts/structs/Option_EventZ.ts new file mode 100644 index 00000000..a1a60c19 --- /dev/null +++ b/ts/structs/Option_EventZ.ts @@ -0,0 +1,64 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +export default class COption_EventZ extends CommonBase { + protected constructor(_dummy: object, ptr: number) { super(ptr); } + protected finalize() { + super.finalize(); + if (this.ptr != 0) { bindings.COption_EventZ_free(this.ptr); } + } + static constr_from_ptr(ptr: number): COption_EventZ { + const raw_val: bindings.LDKCOption_EventZ = bindings.LDKCOption_EventZ_ref_from_ptr(ptr); + if (raw_val instanceof bindings.LDKCOption_EventZ.Some) { + return new Some(this.ptr, raw_val); + } + if (raw_val instanceof bindings.LDKCOption_EventZ.None) { + return new None(this.ptr, raw_val); + } + throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface + } + +} +export class Some extends COption_EventZ { + public some: Event; + private constructor(ptr: number, obj: bindings.LDKCOption_EventZ.Some) { + super(null, ptr); + const some: number = obj.some; + Event some_hu_conv = Event.constr_from_ptr(some); + some_hu_conv.ptrs_to.add(this); + this.some = some_hu_conv; + } +} +export class None extends COption_EventZ { + private constructor(ptr: number, obj: bindings.LDKCOption_EventZ.None) { + super(null, ptr); + } +} + public static Option_EventZ constructor_some(Event o) { + number ret = bindings.COption_EventZ_some(o.ptr); + Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static Option_EventZ constructor_none() { + number ret = bindings.COption_EventZ_none(); + Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public number clone_ptr() { + number ret = bindings.COption_EventZ_clone_ptr(this.ptr); + return ret; + } + + public Option_EventZ clone() { + number ret = bindings.COption_EventZ_clone(this.ptr); + Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Option_MonitorEventZ.ts b/ts/structs/Option_MonitorEventZ.ts new file mode 100644 index 00000000..143df5c9 --- /dev/null +++ b/ts/structs/Option_MonitorEventZ.ts @@ -0,0 +1,64 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +export default class COption_MonitorEventZ extends CommonBase { + protected constructor(_dummy: object, ptr: number) { super(ptr); } + protected finalize() { + super.finalize(); + if (this.ptr != 0) { bindings.COption_MonitorEventZ_free(this.ptr); } + } + static constr_from_ptr(ptr: number): COption_MonitorEventZ { + const raw_val: bindings.LDKCOption_MonitorEventZ = bindings.LDKCOption_MonitorEventZ_ref_from_ptr(ptr); + if (raw_val instanceof bindings.LDKCOption_MonitorEventZ.Some) { + return new Some(this.ptr, raw_val); + } + if (raw_val instanceof bindings.LDKCOption_MonitorEventZ.None) { + return new None(this.ptr, raw_val); + } + throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface + } + +} +export class Some extends COption_MonitorEventZ { + public some: MonitorEvent; + private constructor(ptr: number, obj: bindings.LDKCOption_MonitorEventZ.Some) { + super(null, ptr); + const some: number = obj.some; + MonitorEvent some_hu_conv = MonitorEvent.constr_from_ptr(some); + some_hu_conv.ptrs_to.add(this); + this.some = some_hu_conv; + } +} +export class None extends COption_MonitorEventZ { + private constructor(ptr: number, obj: bindings.LDKCOption_MonitorEventZ.None) { + super(null, ptr); + } +} + public static Option_MonitorEventZ constructor_some(MonitorEvent o) { + number ret = bindings.COption_MonitorEventZ_some(o.ptr); + Option_MonitorEventZ ret_hu_conv = Option_MonitorEventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public static Option_MonitorEventZ constructor_none() { + number ret = bindings.COption_MonitorEventZ_none(); + Option_MonitorEventZ ret_hu_conv = Option_MonitorEventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public number clone_ptr() { + number ret = bindings.COption_MonitorEventZ_clone_ptr(this.ptr); + return ret; + } + + public Option_MonitorEventZ clone() { + number ret = bindings.COption_MonitorEventZ_clone(this.ptr); + Option_MonitorEventZ ret_hu_conv = Option_MonitorEventZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Option_NetworkUpdateZ.ts b/ts/structs/Option_NetworkUpdateZ.ts index 33af24de..959f0c42 100644 --- a/ts/structs/Option_NetworkUpdateZ.ts +++ b/ts/structs/Option_NetworkUpdateZ.ts @@ -49,6 +49,11 @@ export class None extends COption_NetworkUpdateZ { return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.COption_NetworkUpdateZ_clone_ptr(this.ptr); + return ret; + } + public Option_NetworkUpdateZ clone() { number ret = bindings.COption_NetworkUpdateZ_clone(this.ptr); Option_NetworkUpdateZ ret_hu_conv = Option_NetworkUpdateZ.constr_from_ptr(ret); diff --git a/ts/structs/Option_TypeZ.ts b/ts/structs/Option_TypeZ.ts index a9d05e95..b6919288 100644 --- a/ts/structs/Option_TypeZ.ts +++ b/ts/structs/Option_TypeZ.ts @@ -50,6 +50,11 @@ export class None extends COption_TypeZ { return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.COption_TypeZ_clone_ptr(this.ptr); + return ret; + } + public Option_TypeZ clone() { number ret = bindings.COption_TypeZ_clone(this.ptr); Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret); diff --git a/ts/structs/Option_u16Z.ts b/ts/structs/Option_u16Z.ts index e2ccbc90..0c7441d7 100644 --- a/ts/structs/Option_u16Z.ts +++ b/ts/structs/Option_u16Z.ts @@ -46,6 +46,11 @@ export class None extends COption_u16Z { return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.COption_u16Z_clone_ptr(this.ptr); + return ret; + } + public Option_u16Z clone() { number ret = bindings.COption_u16Z_clone(this.ptr); Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret); diff --git a/ts/structs/Option_u32Z.ts b/ts/structs/Option_u32Z.ts index 35daf1ff..a91f74c3 100644 --- a/ts/structs/Option_u32Z.ts +++ b/ts/structs/Option_u32Z.ts @@ -46,6 +46,11 @@ export class None extends COption_u32Z { return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.COption_u32Z_clone_ptr(this.ptr); + return ret; + } + public Option_u32Z clone() { number ret = bindings.COption_u32Z_clone(this.ptr); Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret); diff --git a/ts/structs/Option_u64Z.ts b/ts/structs/Option_u64Z.ts index 1e10d8f5..92aa6781 100644 --- a/ts/structs/Option_u64Z.ts +++ b/ts/structs/Option_u64Z.ts @@ -46,6 +46,11 @@ export class None extends COption_u64Z { return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.COption_u64Z_clone_ptr(this.ptr); + return ret; + } + public Option_u64Z clone() { number ret = bindings.COption_u64Z_clone(this.ptr); Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); diff --git a/ts/structs/OutPoint.ts b/ts/structs/OutPoint.ts index e2fedfc6..29005226 100644 --- a/ts/structs/OutPoint.ts +++ b/ts/structs/OutPoint.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_txid(Uint8Array val) { - bindings.OutPoint_set_txid(this.ptr, val); + bindings.OutPoint_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_index() { @@ -37,12 +37,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static OutPoint constructor_new(Uint8Array txid_arg, number index_arg) { - number ret = bindings.OutPoint_new(txid_arg, index_arg); + number ret = bindings.OutPoint_new(InternalUtils.check_arr_len(txid_arg, 32), index_arg); const ret_hu_conv: OutPoint = new OutPoint(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.OutPoint_clone_ptr(this.ptr); + return ret; + } + public OutPoint clone() { number ret = bindings.OutPoint_clone(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); diff --git a/ts/structs/Payee.ts b/ts/structs/Payee.ts index 699bd71b..a981e13e 100644 --- a/ts/structs/Payee.ts +++ b/ts/structs/Payee.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_pubkey(Uint8Array val) { - bindings.Payee_set_pubkey(this.ptr, val); + bindings.Payee_set_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } public InvoiceFeatures get_features() { @@ -66,12 +66,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static Payee constructor_new(Uint8Array pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg) { - number ret = bindings.Payee_new(pubkey_arg, features_arg == null ? 0 : features_arg.ptr & ~1, route_hints_arg != null ? Arrays.stream(route_hints_arg).map(route_hints_arg_conv_11 -> route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr & ~1).toArray(number[]::new) : null, expiry_time_arg.ptr); + number ret = bindings.Payee_new(InternalUtils.check_arr_len(pubkey_arg, 33), features_arg == null ? 0 : features_arg.ptr & ~1, route_hints_arg != null ? Arrays.stream(route_hints_arg).map(route_hints_arg_conv_11 -> route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr & ~1).toArray(number[]::new) : null, expiry_time_arg.ptr); const ret_hu_conv: Payee = new Payee(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.Payee_clone_ptr(this.ptr); + return ret; + } + public Payee clone() { number ret = bindings.Payee_clone(this.ptr); const ret_hu_conv: Payee = new Payee(null, ret); @@ -102,14 +107,14 @@ import * as bindings from '../bindings' // TODO: figure out location } public static Payee constructor_from_node_id(Uint8Array pubkey) { - number ret = bindings.Payee_from_node_id(pubkey); + number ret = bindings.Payee_from_node_id(InternalUtils.check_arr_len(pubkey, 33)); const ret_hu_conv: Payee = new Payee(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static Payee constructor_for_keysend(Uint8Array pubkey) { - number ret = bindings.Payee_for_keysend(pubkey); + number ret = bindings.Payee_for_keysend(InternalUtils.check_arr_len(pubkey, 33)); const ret_hu_conv: Payee = new Payee(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/PayeePubKey.ts b/ts/structs/PayeePubKey.ts index 8e7373ee..e7d9c930 100644 --- a/ts/structs/PayeePubKey.ts +++ b/ts/structs/PayeePubKey.ts @@ -24,16 +24,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_a(Uint8Array val) { - bindings.PayeePubKey_set_a(this.ptr, val); + bindings.PayeePubKey_set_a(this.ptr, InternalUtils.check_arr_len(val, 33)); } public static PayeePubKey constructor_new(Uint8Array a_arg) { - number ret = bindings.PayeePubKey_new(a_arg); + number ret = bindings.PayeePubKey_new(InternalUtils.check_arr_len(a_arg, 33)); const ret_hu_conv: PayeePubKey = new PayeePubKey(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.PayeePubKey_clone_ptr(this.ptr); + return ret; + } + public PayeePubKey clone() { number ret = bindings.PayeePubKey_clone(this.ptr); const ret_hu_conv: PayeePubKey = new PayeePubKey(null, ret); diff --git a/ts/structs/Payer.ts b/ts/structs/Payer.ts index cd233a61..1e815cb1 100644 --- a/ts/structs/Payer.ts +++ b/ts/structs/Payer.ts @@ -34,26 +34,27 @@ import * as bindings from '../bindings' // TODO: figure out location // todo: in-line interface filling node_id (): Uint8Array { Uint8Array ret = arg.node_id(); - return ret; + result: Uint8Array = InternalUtils.check_arr_len(ret, 33); + return result; }, first_hops (): number[] { ChannelDetails[] ret = arg.first_hops(); - result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_16 -> ret_conv_16 == null ? 0 : ret_conv_16.ptr & ~1).toArray(number[]::new) : null; + result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_16 -> ret_conv_16 == null ? 0 : ret_conv_16.clone_ptr()).toArray(number[]::new) : null; return result; }, send_payment (route: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number { const route_hu_conv: Route = new Route(null, route); Result_PaymentIdPaymentSendFailureZ ret = arg.send_payment(route_hu_conv, payment_hash, payment_secret); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, retry_payment (route: number, payment_id: Uint8Array): number { const route_hu_conv: Route = new Route(null, route); Result_NonePaymentSendFailureZ ret = arg.retry_payment(route_hu_conv, payment_id); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -92,14 +93,14 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, Uint8Array payment_hash, Uint8Array payment_secret) { - number ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret); + number ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32)); Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); return ret_hu_conv; } public Result_NonePaymentSendFailureZ retry_payment(Route route, Uint8Array payment_id) { - number ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_id); + number ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32)); Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); return ret_hu_conv; diff --git a/ts/structs/PaymentError.ts b/ts/structs/PaymentError.ts index da4a31f6..37ee22e3 100644 --- a/ts/structs/PaymentError.ts +++ b/ts/structs/PaymentError.ts @@ -50,6 +50,11 @@ export class Sending extends PaymentError { this.sending = sending_hu_conv; } } + public number clone_ptr() { + number ret = bindings.PaymentError_clone_ptr(this.ptr); + return ret; + } + public PaymentError clone() { number ret = bindings.PaymentError_clone(this.ptr); PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret); diff --git a/ts/structs/PaymentPurpose.ts b/ts/structs/PaymentPurpose.ts index 69a9436d..163b6028 100644 --- a/ts/structs/PaymentPurpose.ts +++ b/ts/structs/PaymentPurpose.ts @@ -38,6 +38,11 @@ export class SpontaneousPayment extends PaymentPurpose { this.spontaneous_payment = obj.spontaneous_payment; } } + public number clone_ptr() { + number ret = bindings.PaymentPurpose_clone_ptr(this.ptr); + return ret; + } + public PaymentPurpose clone() { number ret = bindings.PaymentPurpose_clone(this.ptr); PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret); @@ -46,14 +51,14 @@ export class SpontaneousPayment extends PaymentPurpose { } public static PaymentPurpose constructor_invoice_payment(Uint8Array payment_preimage, Uint8Array payment_secret, number user_payment_id) { - number ret = bindings.PaymentPurpose_invoice_payment(payment_preimage, payment_secret, user_payment_id); + number ret = bindings.PaymentPurpose_invoice_payment(InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_secret, 32), user_payment_id); PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static PaymentPurpose constructor_spontaneous_payment(Uint8Array a) { - number ret = bindings.PaymentPurpose_spontaneous_payment(a); + number ret = bindings.PaymentPurpose_spontaneous_payment(InternalUtils.check_arr_len(a, 32)); PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/PaymentSendFailure.ts b/ts/structs/PaymentSendFailure.ts index 5aa12403..82553689 100644 --- a/ts/structs/PaymentSendFailure.ts +++ b/ts/structs/PaymentSendFailure.ts @@ -86,6 +86,11 @@ export class PartialFailure extends PaymentSendFailure { this.payment_id = obj.payment_id; } } + public number clone_ptr() { + number ret = bindings.PaymentSendFailure_clone_ptr(this.ptr); + return ret; + } + public PaymentSendFailure clone() { number ret = bindings.PaymentSendFailure_clone(this.ptr); PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); @@ -115,7 +120,7 @@ export class PartialFailure extends PaymentSendFailure { } public static PaymentSendFailure constructor_partial_failure(Result_NoneAPIErrorZ[] results, RouteParameters failed_paths_retry, Uint8Array payment_id) { - number ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).map(results_conv_22 -> results_conv_22 != null ? results_conv_22.ptr : 0).toArray(number[]::new) : null, failed_paths_retry == null ? 0 : failed_paths_retry.ptr & ~1, payment_id); + number ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).map(results_conv_22 -> results_conv_22 != null ? results_conv_22.ptr : 0).toArray(number[]::new) : null, failed_paths_retry == null ? 0 : failed_paths_retry.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32)); PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/PeerHandleError.ts b/ts/structs/PeerHandleError.ts index 52504971..7e80b4b9 100644 --- a/ts/structs/PeerHandleError.ts +++ b/ts/structs/PeerHandleError.ts @@ -34,6 +34,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.PeerHandleError_clone_ptr(this.ptr); + return ret; + } + public PeerHandleError clone() { number ret = bindings.PeerHandleError_clone(this.ptr); const ret_hu_conv: PeerHandleError = new PeerHandleError(null, ret); diff --git a/ts/structs/PeerManager.ts b/ts/structs/PeerManager.ts index 1b62d075..1900a954 100644 --- a/ts/structs/PeerManager.ts +++ b/ts/structs/PeerManager.ts @@ -19,7 +19,7 @@ import * as bindings from '../bindings' // TODO: figure out location } } public static PeerManager constructor_new(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, Uint8Array our_node_secret, Uint8Array ephemeral_random_data, Logger logger, CustomMessageHandler custom_message_handler) { - number ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr), our_node_secret, ephemeral_random_data, logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr); + number ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr), InternalUtils.check_arr_len(our_node_secret, 32), InternalUtils.check_arr_len(ephemeral_random_data, 32), logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr); const ret_hu_conv: PeerManager = new PeerManager(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(message_handler_chan_handler_arg); @@ -35,7 +35,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(Uint8Array their_node_id, SocketDescriptor descriptor) { - number ret = bindings.PeerManager_new_outbound_connection(this.ptr, their_node_id, descriptor == null ? 0 : descriptor.ptr); + number ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor == null ? 0 : descriptor.ptr); Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); this.ptrs_to.add(descriptor); return ret_hu_conv; @@ -69,7 +69,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void disconnect_by_node_id(Uint8Array node_id, boolean no_connection_possible) { - bindings.PeerManager_disconnect_by_node_id(this.ptr, node_id, no_connection_possible); + bindings.PeerManager_disconnect_by_node_id(this.ptr, InternalUtils.check_arr_len(node_id, 33), no_connection_possible); } public void disconnect_all_peers() { diff --git a/ts/structs/Persist.ts b/ts/structs/Persist.ts index f13f9b90..3a4b7344 100644 --- a/ts/structs/Persist.ts +++ b/ts/structs/Persist.ts @@ -39,7 +39,7 @@ import * as bindings from '../bindings' // TODO: figure out location const update_id_hu_conv: MonitorUpdateId = new MonitorUpdateId(null, update_id); update_id_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(channel_id_hu_conv, data_hu_conv, update_id_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -51,7 +51,7 @@ import * as bindings from '../bindings' // TODO: figure out location const update_id_hu_conv: MonitorUpdateId = new MonitorUpdateId(null, update_id); update_id_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(channel_id_hu_conv, update_hu_conv, data_hu_conv, update_id_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, diff --git a/ts/structs/Ping.ts b/ts/structs/Ping.ts index f7054fe0..e1a0a848 100644 --- a/ts/structs/Ping.ts +++ b/ts/structs/Ping.ts @@ -43,6 +43,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.Ping_clone_ptr(this.ptr); + return ret; + } + public Ping clone() { number ret = bindings.Ping_clone(this.ptr); const ret_hu_conv: Ping = new Ping(null, ret); diff --git a/ts/structs/Pong.ts b/ts/structs/Pong.ts index 58be169f..c4749eb2 100644 --- a/ts/structs/Pong.ts +++ b/ts/structs/Pong.ts @@ -34,6 +34,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.Pong_clone_ptr(this.ptr); + return ret; + } + public Pong clone() { number ret = bindings.Pong_clone(this.ptr); const ret_hu_conv: Pong = new Pong(null, ret); diff --git a/ts/structs/PositiveTimestamp.ts b/ts/structs/PositiveTimestamp.ts index 8580d269..de2bdcee 100644 --- a/ts/structs/PositiveTimestamp.ts +++ b/ts/structs/PositiveTimestamp.ts @@ -24,6 +24,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.PositiveTimestamp_clone_ptr(this.ptr); + return ret; + } + public PositiveTimestamp clone() { number ret = bindings.PositiveTimestamp_clone(this.ptr); const ret_hu_conv: PositiveTimestamp = new PositiveTimestamp(null, ret); diff --git a/ts/structs/PrivateRoute.ts b/ts/structs/PrivateRoute.ts index 82943df0..fc53d046 100644 --- a/ts/structs/PrivateRoute.ts +++ b/ts/structs/PrivateRoute.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.PrivateRoute_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.PrivateRoute_clone_ptr(this.ptr); + return ret; + } + public PrivateRoute clone() { number ret = bindings.PrivateRoute_clone(this.ptr); const ret_hu_conv: PrivateRoute = new PrivateRoute(null, ret); diff --git a/ts/structs/QueryChannelRange.ts b/ts/structs/QueryChannelRange.ts index 27f68bb8..11c394b8 100644 --- a/ts/structs/QueryChannelRange.ts +++ b/ts/structs/QueryChannelRange.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_chain_hash(Uint8Array val) { - bindings.QueryChannelRange_set_chain_hash(this.ptr, val); + bindings.QueryChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_first_blocknum() { @@ -46,12 +46,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static QueryChannelRange constructor_new(Uint8Array chain_hash_arg, number first_blocknum_arg, number number_of_blocks_arg) { - number ret = bindings.QueryChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg); + number ret = bindings.QueryChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg); const ret_hu_conv: QueryChannelRange = new QueryChannelRange(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.QueryChannelRange_clone_ptr(this.ptr); + return ret; + } + public QueryChannelRange clone() { number ret = bindings.QueryChannelRange_clone(this.ptr); const ret_hu_conv: QueryChannelRange = new QueryChannelRange(null, ret); diff --git a/ts/structs/QueryShortChannelIds.ts b/ts/structs/QueryShortChannelIds.ts index fe6f93f9..5afafcf5 100644 --- a/ts/structs/QueryShortChannelIds.ts +++ b/ts/structs/QueryShortChannelIds.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_chain_hash(Uint8Array val) { - bindings.QueryShortChannelIds_set_chain_hash(this.ptr, val); + bindings.QueryShortChannelIds_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public void set_short_channel_ids(number[] val) { @@ -32,12 +32,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static QueryShortChannelIds constructor_new(Uint8Array chain_hash_arg, number[] short_channel_ids_arg) { - number ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg); + number ret = bindings.QueryShortChannelIds_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_ids_arg); const ret_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.QueryShortChannelIds_clone_ptr(this.ptr); + return ret; + } + public QueryShortChannelIds clone() { number ret = bindings.QueryShortChannelIds_clone(this.ptr); const ret_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, ret); diff --git a/ts/structs/RawDataPart.ts b/ts/structs/RawDataPart.ts index 5f63383b..c4537373 100644 --- a/ts/structs/RawDataPart.ts +++ b/ts/structs/RawDataPart.ts @@ -35,6 +35,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.RawDataPart_clone_ptr(this.ptr); + return ret; + } + public RawDataPart clone() { number ret = bindings.RawDataPart_clone(this.ptr); const ret_hu_conv: RawDataPart = new RawDataPart(null, ret); diff --git a/ts/structs/RawInvoice.ts b/ts/structs/RawInvoice.ts index bb6a5dce..3cd1b041 100644 --- a/ts/structs/RawInvoice.ts +++ b/ts/structs/RawInvoice.ts @@ -35,6 +35,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.RawInvoice_clone_ptr(this.ptr); + return ret; + } + public RawInvoice clone() { number ret = bindings.RawInvoice_clone(this.ptr); const ret_hu_conv: RawInvoice = new RawInvoice(null, ret); diff --git a/ts/structs/ReadOnlyNetworkGraph.ts b/ts/structs/ReadOnlyNetworkGraph.ts index d60088fc..b0a1e25e 100644 --- a/ts/structs/ReadOnlyNetworkGraph.ts +++ b/ts/structs/ReadOnlyNetworkGraph.ts @@ -19,7 +19,7 @@ import * as bindings from '../bindings' // TODO: figure out location } } public Option_CVec_NetAddressZZ get_addresses(Uint8Array pubkey) { - number ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, pubkey); + number ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, InternalUtils.check_arr_len(pubkey, 33)); Option_CVec_NetAddressZZ ret_hu_conv = Option_CVec_NetAddressZZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; diff --git a/ts/structs/Record.ts b/ts/structs/Record.ts new file mode 100644 index 00000000..95fc0e29 --- /dev/null +++ b/ts/structs/Record.ts @@ -0,0 +1,78 @@ + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export default class Record extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.Record_free(this.ptr); + } + } + public Level get_level() { + Level ret = bindings.Record_get_level(this.ptr); + return ret; + } + + public void set_level(Level val) { + bindings.Record_set_level(this.ptr, val); + } + + public String get_args() { + String ret = bindings.Record_get_args(this.ptr); + return ret; + } + + public void set_args(String val) { + bindings.Record_set_args(this.ptr, val); + } + + public String get_module_path() { + String ret = bindings.Record_get_module_path(this.ptr); + return ret; + } + + public void set_module_path(String val) { + bindings.Record_set_module_path(this.ptr, val); + } + + public String get_file() { + String ret = bindings.Record_get_file(this.ptr); + return ret; + } + + public void set_file(String val) { + bindings.Record_set_file(this.ptr, val); + } + + public number get_line() { + number ret = bindings.Record_get_line(this.ptr); + return ret; + } + + public void set_line(number val) { + bindings.Record_set_line(this.ptr, val); + } + + public number clone_ptr() { + number ret = bindings.Record_clone_ptr(this.ptr); + return ret; + } + + public Record clone() { + number ret = bindings.Record_clone(this.ptr); + const ret_hu_conv: Record = new Record(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/ts/structs/ReplyChannelRange.ts b/ts/structs/ReplyChannelRange.ts index bbf199e3..9d3ec28d 100644 --- a/ts/structs/ReplyChannelRange.ts +++ b/ts/structs/ReplyChannelRange.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_chain_hash(Uint8Array val) { - bindings.ReplyChannelRange_set_chain_hash(this.ptr, val); + bindings.ReplyChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_first_blocknum() { @@ -59,12 +59,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ReplyChannelRange constructor_new(Uint8Array chain_hash_arg, number first_blocknum_arg, number number_of_blocks_arg, boolean sync_complete_arg, number[] short_channel_ids_arg) { - number ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg); + number ret = bindings.ReplyChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg); const ret_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ReplyChannelRange_clone_ptr(this.ptr); + return ret; + } + public ReplyChannelRange clone() { number ret = bindings.ReplyChannelRange_clone(this.ptr); const ret_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, ret); diff --git a/ts/structs/ReplyShortChannelIdsEnd.ts b/ts/structs/ReplyShortChannelIdsEnd.ts index ab431a6a..9c3d2881 100644 --- a/ts/structs/ReplyShortChannelIdsEnd.ts +++ b/ts/structs/ReplyShortChannelIdsEnd.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_chain_hash(Uint8Array val) { - bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, val); + bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public boolean get_full_information() { @@ -37,12 +37,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ReplyShortChannelIdsEnd constructor_new(Uint8Array chain_hash_arg, boolean full_information_arg) { - number ret = bindings.ReplyShortChannelIdsEnd_new(chain_hash_arg, full_information_arg); + number ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.check_arr_len(chain_hash_arg, 32), full_information_arg); const ret_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr); + return ret; + } + public ReplyShortChannelIdsEnd clone() { number ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr); const ret_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, ret); diff --git a/ts/structs/Result_AcceptChannelDecodeErrorZ.ts b/ts/structs/Result_AcceptChannelDecodeErrorZ.ts index cffb6512..f8dd75b5 100644 --- a/ts/structs/Result_AcceptChannelDecodeErrorZ.ts +++ b/ts/structs/Result_AcceptChannelDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { } static Result_AcceptChannelDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_AcceptChannelDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_AcceptChannelDecodeErrorZ_is_ok(ptr)) { return new Result_AcceptChannelDecodeErrorZ_OK(null, ptr); } else { return new Result_AcceptChannelDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_AcceptChannelDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_AcceptChannelDecodeErrorZ clone() { number ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone(this.ptr); Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.ts b/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.ts index 812a4532..745f0e4d 100644 --- a/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.ts +++ b/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { } static Result_AnnouncementSignaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(ptr)) { return new Result_AnnouncementSignaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_AnnouncementSignaturesDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_AnnouncementSignaturesDecodeErrorZ clone() { number ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone(this.ptr); Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.ts b/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.ts index 59a2d255..5aef308d 100644 --- a/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.ts +++ b/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { } static Result_BuiltCommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(ptr)) { return new Result_BuiltCommitmentTransactionDecodeErrorZ_OK(null, ptr); } else { return new Result_BuiltCommitmentTransactionDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_BuiltCommitmentTransactionDecodeErrorZ clone() { number ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(this.ptr); Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts b/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts index 86f9d9f8..91789ad3 100644 --- a/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts +++ b/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB } static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(ptr)) { return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(null, ptr); } else { return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(null, ptr); @@ -49,4 +49,9 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts b/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts index fbedce75..3a2f12c5 100644 --- a/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts +++ b/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB } static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(ptr)) { return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(null, ptr); } else { return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ clone() { number ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(this.ptr); Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.ts b/ts/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.ts index 9f4b0123..5708e418 100644 --- a/ts/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.ts +++ b/ts/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.ts @@ -9,7 +9,7 @@ public class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends Com } static Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(ptr)) { + if (bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(ptr)) { return new Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_OK(null, ptr); } else { return new Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends Com return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(this.ptr); + return ret; + } + public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ clone() { number ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(this.ptr); Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts b/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts index b16f5876..5ff71a0a 100644 --- a/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts +++ b/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts @@ -9,7 +9,7 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { } static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(ptr)) { + if (bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(ptr)) { return new Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_OK(null, ptr); } else { return new Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err(null, ptr); @@ -44,6 +44,16 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ clone() { number ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(this.ptr); Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_COption_ClosureReasonZDecodeErrorZ.ts b/ts/structs/Result_COption_ClosureReasonZDecodeErrorZ.ts new file mode 100644 index 00000000..c526901e --- /dev/null +++ b/ts/structs/Result_COption_ClosureReasonZDecodeErrorZ.ts @@ -0,0 +1,68 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +public class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { + private Result_COption_ClosureReasonZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_ClosureReasonZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_COption_ClosureReasonZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_ClosureReasonZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_ClosureReasonZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_ClosureReasonZDecodeErrorZ_OK extends Result_COption_ClosureReasonZDecodeErrorZ { + public final Option_ClosureReasonZ res; + private Result_COption_ClosureReasonZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + number res = bindings.LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_ok(ptr); + Option_ClosureReasonZ res_hu_conv = Option_ClosureReasonZ.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_COption_ClosureReasonZDecodeErrorZ_Err extends Result_COption_ClosureReasonZDecodeErrorZ { + public final DecodeError err; + private Result_COption_ClosureReasonZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + number err = bindings.LDKCResult_COption_ClosureReasonZDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + public static Result_COption_ClosureReasonZDecodeErrorZ constructor_ok(Option_ClosureReasonZ o) { + number ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_ok(o.ptr); + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_COption_ClosureReasonZDecodeErrorZ constructor_err(DecodeError e) { + number ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public boolean is_ok() { + boolean ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + + public Result_COption_ClosureReasonZDecodeErrorZ clone() { + number ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_clone(this.ptr); + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Result_COption_EventZDecodeErrorZ.ts b/ts/structs/Result_COption_EventZDecodeErrorZ.ts new file mode 100644 index 00000000..b346fc2f --- /dev/null +++ b/ts/structs/Result_COption_EventZDecodeErrorZ.ts @@ -0,0 +1,68 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +public class Result_COption_EventZDecodeErrorZ extends CommonBase { + private Result_COption_EventZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_EventZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_COption_EventZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_EventZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_EventZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_EventZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_EventZDecodeErrorZ_OK extends Result_COption_EventZDecodeErrorZ { + public final Option_EventZ res; + private Result_COption_EventZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + number res = bindings.LDKCResult_COption_EventZDecodeErrorZ_get_ok(ptr); + Option_EventZ res_hu_conv = Option_EventZ.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_COption_EventZDecodeErrorZ_Err extends Result_COption_EventZDecodeErrorZ { + public final DecodeError err; + private Result_COption_EventZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + number err = bindings.LDKCResult_COption_EventZDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + public static Result_COption_EventZDecodeErrorZ constructor_ok(Option_EventZ o) { + number ret = bindings.CResult_COption_EventZDecodeErrorZ_ok(o.ptr); + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_COption_EventZDecodeErrorZ constructor_err(DecodeError e) { + number ret = bindings.CResult_COption_EventZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public boolean is_ok() { + boolean ret = bindings.CResult_COption_EventZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_COption_EventZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + + public Result_COption_EventZDecodeErrorZ clone() { + number ret = bindings.CResult_COption_EventZDecodeErrorZ_clone(this.ptr); + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Result_COption_MonitorEventZDecodeErrorZ.ts b/ts/structs/Result_COption_MonitorEventZDecodeErrorZ.ts new file mode 100644 index 00000000..af7855e3 --- /dev/null +++ b/ts/structs/Result_COption_MonitorEventZDecodeErrorZ.ts @@ -0,0 +1,68 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +public class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { + private Result_COption_MonitorEventZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_MonitorEventZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_COption_MonitorEventZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_MonitorEventZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_MonitorEventZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_MonitorEventZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_MonitorEventZDecodeErrorZ_OK extends Result_COption_MonitorEventZDecodeErrorZ { + public final Option_MonitorEventZ res; + private Result_COption_MonitorEventZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + number res = bindings.LDKCResult_COption_MonitorEventZDecodeErrorZ_get_ok(ptr); + Option_MonitorEventZ res_hu_conv = Option_MonitorEventZ.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_COption_MonitorEventZDecodeErrorZ_Err extends Result_COption_MonitorEventZDecodeErrorZ { + public final DecodeError err; + private Result_COption_MonitorEventZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + number err = bindings.LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + public static Result_COption_MonitorEventZDecodeErrorZ constructor_ok(Option_MonitorEventZ o) { + number ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_ok(o.ptr); + Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_COption_MonitorEventZDecodeErrorZ constructor_err(DecodeError e) { + number ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public boolean is_ok() { + boolean ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + + public Result_COption_MonitorEventZDecodeErrorZ clone() { + number ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_clone(this.ptr); + Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Result_COption_NetworkUpdateZDecodeErrorZ.ts b/ts/structs/Result_COption_NetworkUpdateZDecodeErrorZ.ts new file mode 100644 index 00000000..970174c6 --- /dev/null +++ b/ts/structs/Result_COption_NetworkUpdateZDecodeErrorZ.ts @@ -0,0 +1,68 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +public class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { + private Result_COption_NetworkUpdateZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_COption_NetworkUpdateZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(ptr)) { + return new Result_COption_NetworkUpdateZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_COption_NetworkUpdateZDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_COption_NetworkUpdateZDecodeErrorZ_OK extends Result_COption_NetworkUpdateZDecodeErrorZ { + public final Option_NetworkUpdateZ res; + private Result_COption_NetworkUpdateZDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + number res = bindings.LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(ptr); + Option_NetworkUpdateZ res_hu_conv = Option_NetworkUpdateZ.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_COption_NetworkUpdateZDecodeErrorZ_Err extends Result_COption_NetworkUpdateZDecodeErrorZ { + public final DecodeError err; + private Result_COption_NetworkUpdateZDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + number err = bindings.LDKCResult_COption_NetworkUpdateZDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + public static Result_COption_NetworkUpdateZDecodeErrorZ constructor_ok(Option_NetworkUpdateZ o) { + number ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o.ptr); + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_COption_NetworkUpdateZDecodeErrorZ constructor_err(DecodeError e) { + number ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public boolean is_ok() { + boolean ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + + public Result_COption_NetworkUpdateZDecodeErrorZ clone() { + number ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_clone(this.ptr); + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/ts/structs/Result_COption_TypeZDecodeErrorZ.ts b/ts/structs/Result_COption_TypeZDecodeErrorZ.ts index 634da2bc..3207ea4f 100644 --- a/ts/structs/Result_COption_TypeZDecodeErrorZ.ts +++ b/ts/structs/Result_COption_TypeZDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_COption_TypeZDecodeErrorZ extends CommonBase { } static Result_COption_TypeZDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_COption_TypeZDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_COption_TypeZDecodeErrorZ_is_ok(ptr)) { return new Result_COption_TypeZDecodeErrorZ_OK(null, ptr); } else { return new Result_COption_TypeZDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_COption_TypeZDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_COption_TypeZDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_COption_TypeZDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_COption_TypeZDecodeErrorZ clone() { number ret = bindings.CResult_COption_TypeZDecodeErrorZ_clone(this.ptr); Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.ts b/ts/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.ts index e2153029..e211d81a 100644 --- a/ts/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.ts +++ b/ts/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.ts @@ -9,7 +9,7 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB } static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(ptr)) { + if (bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(ptr)) { return new Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_OK(null, ptr); } else { return new Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_Err(null, ptr); @@ -51,6 +51,16 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ clone() { number ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(this.ptr); Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts b/ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts index 52af9438..25385d11 100644 --- a/ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts +++ b/ts/structs/Result_CVec_CVec_u8ZZNoneZ.ts @@ -9,7 +9,7 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { } static Result_CVec_CVec_u8ZZNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(ptr)) { + if (bindings.CResult_CVec_CVec_u8ZZNoneZ_is_ok(ptr)) { return new Result_CVec_CVec_u8ZZNoneZ_OK(null, ptr); } else { return new Result_CVec_CVec_u8ZZNoneZ_Err(null, ptr); @@ -41,6 +41,16 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_CVec_CVec_u8ZZNoneZ clone() { number ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone(this.ptr); Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CVec_SignatureZNoneZ.ts b/ts/structs/Result_CVec_SignatureZNoneZ.ts index df61d033..bb526206 100644 --- a/ts/structs/Result_CVec_SignatureZNoneZ.ts +++ b/ts/structs/Result_CVec_SignatureZNoneZ.ts @@ -9,7 +9,7 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { } static Result_CVec_SignatureZNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_SignatureZNoneZ_result_ok(ptr)) { + if (bindings.CResult_CVec_SignatureZNoneZ_is_ok(ptr)) { return new Result_CVec_SignatureZNoneZ_OK(null, ptr); } else { return new Result_CVec_SignatureZNoneZ_Err(null, ptr); @@ -30,7 +30,7 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { } public static Result_CVec_SignatureZNoneZ constructor_ok(Uint8Array[] o) { - number ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o); + number ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o != null ? Arrays.stream(o).map(o_conv_12 -> InternalUtils.check_arr_len(o_conv_12, 64)).toArray(Uint8Array[]::new) : null); Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -41,6 +41,16 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_SignatureZNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_CVec_SignatureZNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_CVec_SignatureZNoneZ clone() { number ret = bindings.CResult_CVec_SignatureZNoneZ_clone(this.ptr); Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts index a5ef5951..e4ff80b4 100644 --- a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts +++ b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts @@ -9,7 +9,7 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { } static Result_CVec_u8ZPeerHandleErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(ptr)) { + if (bindings.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(ptr)) { return new Result_CVec_u8ZPeerHandleErrorZ_OK(null, ptr); } else { return new Result_CVec_u8ZPeerHandleErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_CVec_u8ZPeerHandleErrorZ clone() { number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr); Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.ts b/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.ts index b06e713c..bc1cf7dc 100644 --- a/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { } static Result_ChannelAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelAnnouncementDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelAnnouncementDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelAnnouncementDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ChannelAnnouncementDecodeErrorZ clone() { number ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone(this.ptr); Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelConfigDecodeErrorZ.ts b/ts/structs/Result_ChannelConfigDecodeErrorZ.ts index 8260d5a5..ec5ec379 100644 --- a/ts/structs/Result_ChannelConfigDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelConfigDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { } static Result_ChannelConfigDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelConfigDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelConfigDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelConfigDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelConfigDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelConfigDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ChannelConfigDecodeErrorZ clone() { number ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone(this.ptr); Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelFeaturesDecodeErrorZ.ts b/ts/structs/Result_ChannelFeaturesDecodeErrorZ.ts index 6a762009..7864a54d 100644 --- a/ts/structs/Result_ChannelFeaturesDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelFeaturesDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { } static Result_ChannelFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelFeaturesDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelFeaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelFeaturesDecodeErrorZ_Err(null, ptr); @@ -49,4 +49,9 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_ChannelInfoDecodeErrorZ.ts b/ts/structs/Result_ChannelInfoDecodeErrorZ.ts index 21031cde..c8d36ecd 100644 --- a/ts/structs/Result_ChannelInfoDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelInfoDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { } static Result_ChannelInfoDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelInfoDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelInfoDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelInfoDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelInfoDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelInfoDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ChannelInfoDecodeErrorZ clone() { number ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone(this.ptr); Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts b/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts index f915a89d..fedae20e 100644 --- a/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { } static Result_ChannelMonitorUpdateDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelMonitorUpdateDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelMonitorUpdateDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ChannelMonitorUpdateDecodeErrorZ clone() { number ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(this.ptr); Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.ts b/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.ts index e6e260dc..feccedd2 100644 --- a/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { } static Result_ChannelPublicKeysDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelPublicKeysDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelPublicKeysDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelPublicKeysDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ChannelPublicKeysDecodeErrorZ clone() { number ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone(this.ptr); Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts b/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts index df386c17..32ad42de 100644 --- a/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { } static Result_ChannelReestablishDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelReestablishDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelReestablishDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelReestablishDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelReestablishDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ChannelReestablishDecodeErrorZ clone() { number ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone(this.ptr); Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.ts b/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.ts index aa3e3ab2..a8151fa4 100644 --- a/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase } static Result_ChannelTransactionParametersDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelTransactionParametersDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelTransactionParametersDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ChannelTransactionParametersDecodeErrorZ clone() { number ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone(this.ptr); Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelUpdateDecodeErrorZ.ts b/ts/structs/Result_ChannelUpdateDecodeErrorZ.ts index 57da57bd..0ed98e4e 100644 --- a/ts/structs/Result_ChannelUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelUpdateDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { } static Result_ChannelUpdateDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ChannelUpdateDecodeErrorZ_is_ok(ptr)) { return new Result_ChannelUpdateDecodeErrorZ_OK(null, ptr); } else { return new Result_ChannelUpdateDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ChannelUpdateDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ChannelUpdateDecodeErrorZ clone() { number ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone(this.ptr); Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ClosingSignedDecodeErrorZ.ts b/ts/structs/Result_ClosingSignedDecodeErrorZ.ts index d7ad4d84..d3ab0794 100644 --- a/ts/structs/Result_ClosingSignedDecodeErrorZ.ts +++ b/ts/structs/Result_ClosingSignedDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { } static Result_ClosingSignedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ClosingSignedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ClosingSignedDecodeErrorZ_is_ok(ptr)) { return new Result_ClosingSignedDecodeErrorZ_OK(null, ptr); } else { return new Result_ClosingSignedDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ClosingSignedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ClosingSignedDecodeErrorZ clone() { number ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone(this.ptr); Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.ts b/ts/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.ts index 971581fa..bf3bc07b 100644 --- a/ts/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.ts +++ b/ts/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { } static Result_ClosingSignedFeeRangeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(ptr)) { return new Result_ClosingSignedFeeRangeDecodeErrorZ_OK(null, ptr); } else { return new Result_ClosingSignedFeeRangeDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ClosingSignedFeeRangeDecodeErrorZ clone() { number ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(this.ptr); Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CommitmentSignedDecodeErrorZ.ts b/ts/structs/Result_CommitmentSignedDecodeErrorZ.ts index fab98b9a..69ee5978 100644 --- a/ts/structs/Result_CommitmentSignedDecodeErrorZ.ts +++ b/ts/structs/Result_CommitmentSignedDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { } static Result_CommitmentSignedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_CommitmentSignedDecodeErrorZ_is_ok(ptr)) { return new Result_CommitmentSignedDecodeErrorZ_OK(null, ptr); } else { return new Result_CommitmentSignedDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_CommitmentSignedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_CommitmentSignedDecodeErrorZ clone() { number ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone(this.ptr); Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CommitmentTransactionDecodeErrorZ.ts b/ts/structs/Result_CommitmentTransactionDecodeErrorZ.ts index 6d49cc81..de0ee7c0 100644 --- a/ts/structs/Result_CommitmentTransactionDecodeErrorZ.ts +++ b/ts/structs/Result_CommitmentTransactionDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { } static Result_CommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_CommitmentTransactionDecodeErrorZ_is_ok(ptr)) { return new Result_CommitmentTransactionDecodeErrorZ_OK(null, ptr); } else { return new Result_CommitmentTransactionDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_CommitmentTransactionDecodeErrorZ clone() { number ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone(this.ptr); Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.ts b/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.ts index d7b98a10..2ba9e597 100644 --- a/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.ts +++ b/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends } static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(ptr)) { return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(null, ptr); } else { return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_CounterpartyChannelTransactionParametersDecodeErrorZ clone() { number ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(this.ptr); Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.ts b/ts/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.ts index 41dedd56..2a64ba03 100644 --- a/ts/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.ts +++ b/ts/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas } static Result_DelayedPaymentOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(ptr)) { return new Result_DelayedPaymentOutputDescriptorDecodeErrorZ_OK(null, ptr); } else { return new Result_DelayedPaymentOutputDescriptorDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_DelayedPaymentOutputDescriptorDecodeErrorZ clone() { number ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr); Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_DescriptionCreationErrorZ.ts b/ts/structs/Result_DescriptionCreationErrorZ.ts index 553a99db..f68ac0f4 100644 --- a/ts/structs/Result_DescriptionCreationErrorZ.ts +++ b/ts/structs/Result_DescriptionCreationErrorZ.ts @@ -9,7 +9,7 @@ public class Result_DescriptionCreationErrorZ extends CommonBase { } static Result_DescriptionCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_DescriptionCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_DescriptionCreationErrorZ_is_ok(ptr)) { return new Result_DescriptionCreationErrorZ_OK(null, ptr); } else { return new Result_DescriptionCreationErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_DescriptionCreationErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_DescriptionCreationErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_DescriptionCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_DescriptionCreationErrorZ clone() { number ret = bindings.CResult_DescriptionCreationErrorZ_clone(this.ptr); Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.ts b/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.ts index caa6c602..352ddcbe 100644 --- a/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.ts +++ b/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { } static Result_DirectionalChannelInfoDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(ptr)) { return new Result_DirectionalChannelInfoDecodeErrorZ_OK(null, ptr); } else { return new Result_DirectionalChannelInfoDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_DirectionalChannelInfoDecodeErrorZ clone() { number ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone(this.ptr); Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ErrorMessageDecodeErrorZ.ts b/ts/structs/Result_ErrorMessageDecodeErrorZ.ts index 59e5a53a..15912b08 100644 --- a/ts/structs/Result_ErrorMessageDecodeErrorZ.ts +++ b/ts/structs/Result_ErrorMessageDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { } static Result_ErrorMessageDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ErrorMessageDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ErrorMessageDecodeErrorZ_is_ok(ptr)) { return new Result_ErrorMessageDecodeErrorZ_OK(null, ptr); } else { return new Result_ErrorMessageDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ErrorMessageDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ErrorMessageDecodeErrorZ clone() { number ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone(this.ptr); Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ExpiryTimeCreationErrorZ.ts b/ts/structs/Result_ExpiryTimeCreationErrorZ.ts index b4038d2e..6e62befd 100644 --- a/ts/structs/Result_ExpiryTimeCreationErrorZ.ts +++ b/ts/structs/Result_ExpiryTimeCreationErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ExpiryTimeCreationErrorZ extends CommonBase { } static Result_ExpiryTimeCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ExpiryTimeCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_ExpiryTimeCreationErrorZ_is_ok(ptr)) { return new Result_ExpiryTimeCreationErrorZ_OK(null, ptr); } else { return new Result_ExpiryTimeCreationErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_ExpiryTimeCreationErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ExpiryTimeCreationErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ExpiryTimeCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ExpiryTimeCreationErrorZ clone() { number ret = bindings.CResult_ExpiryTimeCreationErrorZ_clone(this.ptr); Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_FundingCreatedDecodeErrorZ.ts b/ts/structs/Result_FundingCreatedDecodeErrorZ.ts index b4126730..07ab44e3 100644 --- a/ts/structs/Result_FundingCreatedDecodeErrorZ.ts +++ b/ts/structs/Result_FundingCreatedDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { } static Result_FundingCreatedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_FundingCreatedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_FundingCreatedDecodeErrorZ_is_ok(ptr)) { return new Result_FundingCreatedDecodeErrorZ_OK(null, ptr); } else { return new Result_FundingCreatedDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_FundingCreatedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_FundingCreatedDecodeErrorZ clone() { number ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone(this.ptr); Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_FundingLockedDecodeErrorZ.ts b/ts/structs/Result_FundingLockedDecodeErrorZ.ts index ae6717ab..a2432d0c 100644 --- a/ts/structs/Result_FundingLockedDecodeErrorZ.ts +++ b/ts/structs/Result_FundingLockedDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase { } static Result_FundingLockedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_FundingLockedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_FundingLockedDecodeErrorZ_is_ok(ptr)) { return new Result_FundingLockedDecodeErrorZ_OK(null, ptr); } else { return new Result_FundingLockedDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_FundingLockedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_FundingLockedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_FundingLockedDecodeErrorZ clone() { number ret = bindings.CResult_FundingLockedDecodeErrorZ_clone(this.ptr); Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_FundingSignedDecodeErrorZ.ts b/ts/structs/Result_FundingSignedDecodeErrorZ.ts index c789c328..112ad99e 100644 --- a/ts/structs/Result_FundingSignedDecodeErrorZ.ts +++ b/ts/structs/Result_FundingSignedDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { } static Result_FundingSignedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_FundingSignedDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_FundingSignedDecodeErrorZ_is_ok(ptr)) { return new Result_FundingSignedDecodeErrorZ_OK(null, ptr); } else { return new Result_FundingSignedDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_FundingSignedDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_FundingSignedDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_FundingSignedDecodeErrorZ clone() { number ret = bindings.CResult_FundingSignedDecodeErrorZ_clone(this.ptr); Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts b/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts index 0fe6c279..e867ead0 100644 --- a/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts +++ b/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { } static Result_GossipTimestampFilterDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_GossipTimestampFilterDecodeErrorZ_is_ok(ptr)) { return new Result_GossipTimestampFilterDecodeErrorZ_OK(null, ptr); } else { return new Result_GossipTimestampFilterDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_GossipTimestampFilterDecodeErrorZ clone() { number ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone(this.ptr); Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.ts b/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.ts index 56ac8953..8bcc7e12 100644 --- a/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.ts +++ b/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { } static Result_HTLCOutputInCommitmentDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(ptr)) { return new Result_HTLCOutputInCommitmentDecodeErrorZ_OK(null, ptr); } else { return new Result_HTLCOutputInCommitmentDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_HTLCOutputInCommitmentDecodeErrorZ clone() { number ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(this.ptr); Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_HTLCUpdateDecodeErrorZ.ts b/ts/structs/Result_HTLCUpdateDecodeErrorZ.ts index 46409093..e950edf0 100644 --- a/ts/structs/Result_HTLCUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_HTLCUpdateDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { } static Result_HTLCUpdateDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_HTLCUpdateDecodeErrorZ_is_ok(ptr)) { return new Result_HTLCUpdateDecodeErrorZ_OK(null, ptr); } else { return new Result_HTLCUpdateDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_HTLCUpdateDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_HTLCUpdateDecodeErrorZ clone() { number ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone(this.ptr); Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.ts b/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.ts index 7decfef0..43266182 100644 --- a/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.ts +++ b/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { } static Result_HolderCommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(ptr)) { return new Result_HolderCommitmentTransactionDecodeErrorZ_OK(null, ptr); } else { return new Result_HolderCommitmentTransactionDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_HolderCommitmentTransactionDecodeErrorZ clone() { number ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone(this.ptr); Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_InMemorySignerDecodeErrorZ.ts b/ts/structs/Result_InMemorySignerDecodeErrorZ.ts index 63692c3e..15c4b734 100644 --- a/ts/structs/Result_InMemorySignerDecodeErrorZ.ts +++ b/ts/structs/Result_InMemorySignerDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { } static Result_InMemorySignerDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InMemorySignerDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_InMemorySignerDecodeErrorZ_is_ok(ptr)) { return new Result_InMemorySignerDecodeErrorZ_OK(null, ptr); } else { return new Result_InMemorySignerDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_InMemorySignerDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_InMemorySignerDecodeErrorZ clone() { number ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone(this.ptr); Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_InitDecodeErrorZ.ts b/ts/structs/Result_InitDecodeErrorZ.ts index 5cd3490a..ef549f0d 100644 --- a/ts/structs/Result_InitDecodeErrorZ.ts +++ b/ts/structs/Result_InitDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_InitDecodeErrorZ extends CommonBase { } static Result_InitDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InitDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_InitDecodeErrorZ_is_ok(ptr)) { return new Result_InitDecodeErrorZ_OK(null, ptr); } else { return new Result_InitDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_InitDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_InitDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_InitDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_InitDecodeErrorZ clone() { number ret = bindings.CResult_InitDecodeErrorZ_clone(this.ptr); Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_InitFeaturesDecodeErrorZ.ts b/ts/structs/Result_InitFeaturesDecodeErrorZ.ts index 0ad8b921..d3adc293 100644 --- a/ts/structs/Result_InitFeaturesDecodeErrorZ.ts +++ b/ts/structs/Result_InitFeaturesDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { } static Result_InitFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InitFeaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_InitFeaturesDecodeErrorZ_is_ok(ptr)) { return new Result_InitFeaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_InitFeaturesDecodeErrorZ_Err(null, ptr); @@ -49,4 +49,9 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_InitFeaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.ts b/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.ts index 1cc87654..e86d9137 100644 --- a/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.ts +++ b/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { } static Result_InvoiceFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(ptr)) { return new Result_InvoiceFeaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_InvoiceFeaturesDecodeErrorZ_Err(null, ptr); @@ -49,4 +49,9 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_InvoiceNoneZ.ts b/ts/structs/Result_InvoiceNoneZ.ts index 5b765330..689e5caf 100644 --- a/ts/structs/Result_InvoiceNoneZ.ts +++ b/ts/structs/Result_InvoiceNoneZ.ts @@ -9,7 +9,7 @@ public class Result_InvoiceNoneZ extends CommonBase { } static Result_InvoiceNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InvoiceNoneZ_result_ok(ptr)) { + if (bindings.CResult_InvoiceNoneZ_is_ok(ptr)) { return new Result_InvoiceNoneZ_OK(null, ptr); } else { return new Result_InvoiceNoneZ_Err(null, ptr); @@ -44,6 +44,16 @@ public class Result_InvoiceNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_InvoiceNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_InvoiceNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_InvoiceNoneZ clone() { number ret = bindings.CResult_InvoiceNoneZ_clone(this.ptr); Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_InvoiceSemanticErrorZ.ts b/ts/structs/Result_InvoiceSemanticErrorZ.ts index 19539891..86271c30 100644 --- a/ts/structs/Result_InvoiceSemanticErrorZ.ts +++ b/ts/structs/Result_InvoiceSemanticErrorZ.ts @@ -9,7 +9,7 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase { } static Result_InvoiceSemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InvoiceSemanticErrorZ_result_ok(ptr)) { + if (bindings.CResult_InvoiceSemanticErrorZ_is_ok(ptr)) { return new Result_InvoiceSemanticErrorZ_OK(null, ptr); } else { return new Result_InvoiceSemanticErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_InvoiceSemanticErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_InvoiceSemanticErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_InvoiceSemanticErrorZ clone() { number ret = bindings.CResult_InvoiceSemanticErrorZ_clone(this.ptr); Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_InvoiceSignOrCreationErrorZ.ts b/ts/structs/Result_InvoiceSignOrCreationErrorZ.ts index c9578f04..c9e7ff57 100644 --- a/ts/structs/Result_InvoiceSignOrCreationErrorZ.ts +++ b/ts/structs/Result_InvoiceSignOrCreationErrorZ.ts @@ -9,7 +9,7 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase { } static Result_InvoiceSignOrCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_InvoiceSignOrCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_InvoiceSignOrCreationErrorZ_is_ok(ptr)) { return new Result_InvoiceSignOrCreationErrorZ_OK(null, ptr); } else { return new Result_InvoiceSignOrCreationErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_InvoiceSignOrCreationErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_InvoiceSignOrCreationErrorZ clone() { number ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone(this.ptr); Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_LockedChannelMonitorNoneZ.ts b/ts/structs/Result_LockedChannelMonitorNoneZ.ts index 67ab8e15..28eac649 100644 --- a/ts/structs/Result_LockedChannelMonitorNoneZ.ts +++ b/ts/structs/Result_LockedChannelMonitorNoneZ.ts @@ -9,7 +9,7 @@ public class Result_LockedChannelMonitorNoneZ extends CommonBase { } static Result_LockedChannelMonitorNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_LockedChannelMonitorNoneZ_result_ok(ptr)) { + if (bindings.CResult_LockedChannelMonitorNoneZ_is_ok(ptr)) { return new Result_LockedChannelMonitorNoneZ_OK(null, ptr); } else { return new Result_LockedChannelMonitorNoneZ_Err(null, ptr); @@ -53,4 +53,9 @@ public class Result_LockedChannelMonitorNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_LockedChannelMonitorNoneZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_NetAddressDecodeErrorZ.ts b/ts/structs/Result_NetAddressDecodeErrorZ.ts index 4324ec8b..044797e4 100644 --- a/ts/structs/Result_NetAddressDecodeErrorZ.ts +++ b/ts/structs/Result_NetAddressDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase { } static Result_NetAddressDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NetAddressDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NetAddressDecodeErrorZ_is_ok(ptr)) { return new Result_NetAddressDecodeErrorZ_OK(null, ptr); } else { return new Result_NetAddressDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NetAddressDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NetAddressDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NetAddressDecodeErrorZ clone() { number ret = bindings.CResult_NetAddressDecodeErrorZ_clone(this.ptr); Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NetworkGraphDecodeErrorZ.ts b/ts/structs/Result_NetworkGraphDecodeErrorZ.ts index 950f8403..11188415 100644 --- a/ts/structs/Result_NetworkGraphDecodeErrorZ.ts +++ b/ts/structs/Result_NetworkGraphDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { } static Result_NetworkGraphDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NetworkGraphDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NetworkGraphDecodeErrorZ_is_ok(ptr)) { return new Result_NetworkGraphDecodeErrorZ_OK(null, ptr); } else { return new Result_NetworkGraphDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NetworkGraphDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NetworkGraphDecodeErrorZ clone() { number ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone(this.ptr); Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NodeAnnouncementDecodeErrorZ.ts b/ts/structs/Result_NodeAnnouncementDecodeErrorZ.ts index a0dba6af..aaab5e96 100644 --- a/ts/structs/Result_NodeAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_NodeAnnouncementDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { } static Result_NodeAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeAnnouncementDecodeErrorZ_is_ok(ptr)) { return new Result_NodeAnnouncementDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeAnnouncementDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NodeAnnouncementDecodeErrorZ clone() { number ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone(this.ptr); Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts b/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts index 4ce84e36..b8ee77f9 100644 --- a/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts +++ b/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { } static Result_NodeAnnouncementInfoDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(ptr)) { return new Result_NodeAnnouncementInfoDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeAnnouncementInfoDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NodeAnnouncementInfoDecodeErrorZ clone() { number ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone(this.ptr); Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NodeFeaturesDecodeErrorZ.ts b/ts/structs/Result_NodeFeaturesDecodeErrorZ.ts index ce3cbcf2..64a8e638 100644 --- a/ts/structs/Result_NodeFeaturesDecodeErrorZ.ts +++ b/ts/structs/Result_NodeFeaturesDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { } static Result_NodeFeaturesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeFeaturesDecodeErrorZ_is_ok(ptr)) { return new Result_NodeFeaturesDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeFeaturesDecodeErrorZ_Err(null, ptr); @@ -49,4 +49,9 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NodeFeaturesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_NodeIdDecodeErrorZ.ts b/ts/structs/Result_NodeIdDecodeErrorZ.ts index 1a6ec7e0..5fb82dc3 100644 --- a/ts/structs/Result_NodeIdDecodeErrorZ.ts +++ b/ts/structs/Result_NodeIdDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { } static Result_NodeIdDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeIdDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeIdDecodeErrorZ_is_ok(ptr)) { return new Result_NodeIdDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeIdDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NodeIdDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NodeIdDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NodeIdDecodeErrorZ clone() { number ret = bindings.CResult_NodeIdDecodeErrorZ_clone(this.ptr); Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NodeInfoDecodeErrorZ.ts b/ts/structs/Result_NodeInfoDecodeErrorZ.ts index d52fae8d..3f785d25 100644 --- a/ts/structs/Result_NodeInfoDecodeErrorZ.ts +++ b/ts/structs/Result_NodeInfoDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { } static Result_NodeInfoDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NodeInfoDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_NodeInfoDecodeErrorZ_is_ok(ptr)) { return new Result_NodeInfoDecodeErrorZ_OK(null, ptr); } else { return new Result_NodeInfoDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NodeInfoDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NodeInfoDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NodeInfoDecodeErrorZ clone() { number ret = bindings.CResult_NodeInfoDecodeErrorZ_clone(this.ptr); Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneAPIErrorZ.ts b/ts/structs/Result_NoneAPIErrorZ.ts index adc37dd6..76b46084 100644 --- a/ts/structs/Result_NoneAPIErrorZ.ts +++ b/ts/structs/Result_NoneAPIErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NoneAPIErrorZ extends CommonBase { } static Result_NoneAPIErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneAPIErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneAPIErrorZ_is_ok(ptr)) { return new Result_NoneAPIErrorZ_OK(null, ptr); } else { return new Result_NoneAPIErrorZ_Err(null, ptr); @@ -44,6 +44,16 @@ public class Result_NoneAPIErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NoneAPIErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NoneAPIErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NoneAPIErrorZ clone() { number ret = bindings.CResult_NoneAPIErrorZ_clone(this.ptr); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneChannelMonitorUpdateErrZ.ts b/ts/structs/Result_NoneChannelMonitorUpdateErrZ.ts index b22b3653..3bfe878e 100644 --- a/ts/structs/Result_NoneChannelMonitorUpdateErrZ.ts +++ b/ts/structs/Result_NoneChannelMonitorUpdateErrZ.ts @@ -9,7 +9,7 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { } static Result_NoneChannelMonitorUpdateErrZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(ptr)) { + if (bindings.CResult_NoneChannelMonitorUpdateErrZ_is_ok(ptr)) { return new Result_NoneChannelMonitorUpdateErrZ_OK(null, ptr); } else { return new Result_NoneChannelMonitorUpdateErrZ_Err(null, ptr); @@ -41,6 +41,16 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(this.ptr); + return ret; + } + public Result_NoneChannelMonitorUpdateErrZ clone() { number ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone(this.ptr); Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneErrorZ.ts b/ts/structs/Result_NoneErrorZ.ts index 5e61813f..7e8df21d 100644 --- a/ts/structs/Result_NoneErrorZ.ts +++ b/ts/structs/Result_NoneErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NoneErrorZ extends CommonBase { } static Result_NoneErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneErrorZ_is_ok(ptr)) { return new Result_NoneErrorZ_OK(null, ptr); } else { return new Result_NoneErrorZ_Err(null, ptr); @@ -41,6 +41,16 @@ public class Result_NoneErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NoneErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NoneErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NoneErrorZ clone() { number ret = bindings.CResult_NoneErrorZ_clone(this.ptr); Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneLightningErrorZ.ts b/ts/structs/Result_NoneLightningErrorZ.ts index a796ee9e..8630f41a 100644 --- a/ts/structs/Result_NoneLightningErrorZ.ts +++ b/ts/structs/Result_NoneLightningErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NoneLightningErrorZ extends CommonBase { } static Result_NoneLightningErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneLightningErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneLightningErrorZ_is_ok(ptr)) { return new Result_NoneLightningErrorZ_OK(null, ptr); } else { return new Result_NoneLightningErrorZ_Err(null, ptr); @@ -44,6 +44,16 @@ public class Result_NoneLightningErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NoneLightningErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NoneLightningErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NoneLightningErrorZ clone() { number ret = bindings.CResult_NoneLightningErrorZ_clone(this.ptr); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneMonitorUpdateErrorZ.ts b/ts/structs/Result_NoneMonitorUpdateErrorZ.ts index 75082d32..78ebc67b 100644 --- a/ts/structs/Result_NoneMonitorUpdateErrorZ.ts +++ b/ts/structs/Result_NoneMonitorUpdateErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { } static Result_NoneMonitorUpdateErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneMonitorUpdateErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneMonitorUpdateErrorZ_is_ok(ptr)) { return new Result_NoneMonitorUpdateErrorZ_OK(null, ptr); } else { return new Result_NoneMonitorUpdateErrorZ_Err(null, ptr); @@ -44,6 +44,16 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NoneMonitorUpdateErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NoneMonitorUpdateErrorZ clone() { number ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone(this.ptr); Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneNoneZ.ts b/ts/structs/Result_NoneNoneZ.ts index d7939fa1..4beac56c 100644 --- a/ts/structs/Result_NoneNoneZ.ts +++ b/ts/structs/Result_NoneNoneZ.ts @@ -9,7 +9,7 @@ public class Result_NoneNoneZ extends CommonBase { } static Result_NoneNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneNoneZ_result_ok(ptr)) { + if (bindings.CResult_NoneNoneZ_is_ok(ptr)) { return new Result_NoneNoneZ_OK(null, ptr); } else { return new Result_NoneNoneZ_Err(null, ptr); @@ -39,6 +39,16 @@ public class Result_NoneNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NoneNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NoneNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_NoneNoneZ clone() { number ret = bindings.CResult_NoneNoneZ_clone(this.ptr); Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NonePaymentSendFailureZ.ts b/ts/structs/Result_NonePaymentSendFailureZ.ts index 69a0ec15..73dd48e2 100644 --- a/ts/structs/Result_NonePaymentSendFailureZ.ts +++ b/ts/structs/Result_NonePaymentSendFailureZ.ts @@ -9,7 +9,7 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { } static Result_NonePaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NonePaymentSendFailureZ_result_ok(ptr)) { + if (bindings.CResult_NonePaymentSendFailureZ_is_ok(ptr)) { return new Result_NonePaymentSendFailureZ_OK(null, ptr); } else { return new Result_NonePaymentSendFailureZ_Err(null, ptr); @@ -44,6 +44,16 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NonePaymentSendFailureZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NonePaymentSendFailureZ_clone_ptr(this.ptr); + return ret; + } + public Result_NonePaymentSendFailureZ clone() { number ret = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr); Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NonePeerHandleErrorZ.ts b/ts/structs/Result_NonePeerHandleErrorZ.ts index 9925e91c..1da48f86 100644 --- a/ts/structs/Result_NonePeerHandleErrorZ.ts +++ b/ts/structs/Result_NonePeerHandleErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { } static Result_NonePeerHandleErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NonePeerHandleErrorZ_result_ok(ptr)) { + if (bindings.CResult_NonePeerHandleErrorZ_is_ok(ptr)) { return new Result_NonePeerHandleErrorZ_OK(null, ptr); } else { return new Result_NonePeerHandleErrorZ_Err(null, ptr); @@ -44,6 +44,16 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NonePeerHandleErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NonePeerHandleErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NonePeerHandleErrorZ clone() { number ret = bindings.CResult_NonePeerHandleErrorZ_clone(this.ptr); Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneSemanticErrorZ.ts b/ts/structs/Result_NoneSemanticErrorZ.ts index b374cfd5..ec49cdb3 100644 --- a/ts/structs/Result_NoneSemanticErrorZ.ts +++ b/ts/structs/Result_NoneSemanticErrorZ.ts @@ -9,7 +9,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase { } static Result_NoneSemanticErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_NoneSemanticErrorZ_result_ok(ptr)) { + if (bindings.CResult_NoneSemanticErrorZ_is_ok(ptr)) { return new Result_NoneSemanticErrorZ_OK(null, ptr); } else { return new Result_NoneSemanticErrorZ_Err(null, ptr); @@ -41,6 +41,16 @@ public class Result_NoneSemanticErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_NoneSemanticErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_NoneSemanticErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_NoneSemanticErrorZ clone() { number ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr); Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_OpenChannelDecodeErrorZ.ts b/ts/structs/Result_OpenChannelDecodeErrorZ.ts index 874a9e1d..fa1c6389 100644 --- a/ts/structs/Result_OpenChannelDecodeErrorZ.ts +++ b/ts/structs/Result_OpenChannelDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { } static Result_OpenChannelDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_OpenChannelDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_OpenChannelDecodeErrorZ_is_ok(ptr)) { return new Result_OpenChannelDecodeErrorZ_OK(null, ptr); } else { return new Result_OpenChannelDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_OpenChannelDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_OpenChannelDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_OpenChannelDecodeErrorZ clone() { number ret = bindings.CResult_OpenChannelDecodeErrorZ_clone(this.ptr); Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_OutPointDecodeErrorZ.ts b/ts/structs/Result_OutPointDecodeErrorZ.ts index 85558e36..97099d7c 100644 --- a/ts/structs/Result_OutPointDecodeErrorZ.ts +++ b/ts/structs/Result_OutPointDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { } static Result_OutPointDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_OutPointDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_OutPointDecodeErrorZ_is_ok(ptr)) { return new Result_OutPointDecodeErrorZ_OK(null, ptr); } else { return new Result_OutPointDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_OutPointDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_OutPointDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_OutPointDecodeErrorZ clone() { number ret = bindings.CResult_OutPointDecodeErrorZ_clone(this.ptr); Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PayeeDecodeErrorZ.ts b/ts/structs/Result_PayeeDecodeErrorZ.ts index 1eed1cc3..4a1cf86d 100644 --- a/ts/structs/Result_PayeeDecodeErrorZ.ts +++ b/ts/structs/Result_PayeeDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PayeeDecodeErrorZ extends CommonBase { } static Result_PayeeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PayeeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_PayeeDecodeErrorZ_is_ok(ptr)) { return new Result_PayeeDecodeErrorZ_OK(null, ptr); } else { return new Result_PayeeDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_PayeeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PayeeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PayeeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PayeeDecodeErrorZ clone() { number ret = bindings.CResult_PayeeDecodeErrorZ_clone(this.ptr); Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PayeePubKeyErrorZ.ts b/ts/structs/Result_PayeePubKeyErrorZ.ts index 871d8843..1a5c93cd 100644 --- a/ts/structs/Result_PayeePubKeyErrorZ.ts +++ b/ts/structs/Result_PayeePubKeyErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PayeePubKeyErrorZ extends CommonBase { } static Result_PayeePubKeyErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PayeePubKeyErrorZ_result_ok(ptr)) { + if (bindings.CResult_PayeePubKeyErrorZ_is_ok(ptr)) { return new Result_PayeePubKeyErrorZ_OK(null, ptr); } else { return new Result_PayeePubKeyErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_PayeePubKeyErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PayeePubKeyErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PayeePubKeyErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PayeePubKeyErrorZ clone() { number ret = bindings.CResult_PayeePubKeyErrorZ_clone(this.ptr); Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PaymentIdPaymentErrorZ.ts b/ts/structs/Result_PaymentIdPaymentErrorZ.ts index 7b9eeb21..31efaae1 100644 --- a/ts/structs/Result_PaymentIdPaymentErrorZ.ts +++ b/ts/structs/Result_PaymentIdPaymentErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PaymentIdPaymentErrorZ extends CommonBase { } static Result_PaymentIdPaymentErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PaymentIdPaymentErrorZ_result_ok(ptr)) { + if (bindings.CResult_PaymentIdPaymentErrorZ_is_ok(ptr)) { return new Result_PaymentIdPaymentErrorZ_OK(null, ptr); } else { return new Result_PaymentIdPaymentErrorZ_Err(null, ptr); @@ -35,7 +35,7 @@ public class Result_PaymentIdPaymentErrorZ extends CommonBase { } public static Result_PaymentIdPaymentErrorZ constructor_ok(Uint8Array o) { - number ret = bindings.CResult_PaymentIdPaymentErrorZ_ok(o); + number ret = bindings.CResult_PaymentIdPaymentErrorZ_ok(InternalUtils.check_arr_len(o, 32)); Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -46,6 +46,16 @@ public class Result_PaymentIdPaymentErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PaymentIdPaymentErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PaymentIdPaymentErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PaymentIdPaymentErrorZ clone() { number ret = bindings.CResult_PaymentIdPaymentErrorZ_clone(this.ptr); Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PaymentIdPaymentSendFailureZ.ts b/ts/structs/Result_PaymentIdPaymentSendFailureZ.ts index f55ee059..c1331d00 100644 --- a/ts/structs/Result_PaymentIdPaymentSendFailureZ.ts +++ b/ts/structs/Result_PaymentIdPaymentSendFailureZ.ts @@ -9,7 +9,7 @@ public class Result_PaymentIdPaymentSendFailureZ extends CommonBase { } static Result_PaymentIdPaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(ptr)) { + if (bindings.CResult_PaymentIdPaymentSendFailureZ_is_ok(ptr)) { return new Result_PaymentIdPaymentSendFailureZ_OK(null, ptr); } else { return new Result_PaymentIdPaymentSendFailureZ_Err(null, ptr); @@ -35,7 +35,7 @@ public class Result_PaymentIdPaymentSendFailureZ extends CommonBase { } public static Result_PaymentIdPaymentSendFailureZ constructor_ok(Uint8Array o) { - number ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(o); + number ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(InternalUtils.check_arr_len(o, 32)); Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -46,6 +46,16 @@ public class Result_PaymentIdPaymentSendFailureZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PaymentIdPaymentSendFailureZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone_ptr(this.ptr); + return ret; + } + public Result_PaymentIdPaymentSendFailureZ clone() { number ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone(this.ptr); Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PaymentSecretAPIErrorZ.ts b/ts/structs/Result_PaymentSecretAPIErrorZ.ts index bc1caa2e..906f575b 100644 --- a/ts/structs/Result_PaymentSecretAPIErrorZ.ts +++ b/ts/structs/Result_PaymentSecretAPIErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase { } static Result_PaymentSecretAPIErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PaymentSecretAPIErrorZ_result_ok(ptr)) { + if (bindings.CResult_PaymentSecretAPIErrorZ_is_ok(ptr)) { return new Result_PaymentSecretAPIErrorZ_OK(null, ptr); } else { return new Result_PaymentSecretAPIErrorZ_Err(null, ptr); @@ -35,7 +35,7 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase { } public static Result_PaymentSecretAPIErrorZ constructor_ok(Uint8Array o) { - number ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(o); + number ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(InternalUtils.check_arr_len(o, 32)); Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -46,6 +46,16 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PaymentSecretAPIErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PaymentSecretAPIErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PaymentSecretAPIErrorZ clone() { number ret = bindings.CResult_PaymentSecretAPIErrorZ_clone(this.ptr); Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PingDecodeErrorZ.ts b/ts/structs/Result_PingDecodeErrorZ.ts index f7ee22b9..5351a3cb 100644 --- a/ts/structs/Result_PingDecodeErrorZ.ts +++ b/ts/structs/Result_PingDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PingDecodeErrorZ extends CommonBase { } static Result_PingDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PingDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_PingDecodeErrorZ_is_ok(ptr)) { return new Result_PingDecodeErrorZ_OK(null, ptr); } else { return new Result_PingDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_PingDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PingDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PingDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PingDecodeErrorZ clone() { number ret = bindings.CResult_PingDecodeErrorZ_clone(this.ptr); Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PongDecodeErrorZ.ts b/ts/structs/Result_PongDecodeErrorZ.ts index 1e84dee8..10a2eb71 100644 --- a/ts/structs/Result_PongDecodeErrorZ.ts +++ b/ts/structs/Result_PongDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PongDecodeErrorZ extends CommonBase { } static Result_PongDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PongDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_PongDecodeErrorZ_is_ok(ptr)) { return new Result_PongDecodeErrorZ_OK(null, ptr); } else { return new Result_PongDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_PongDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PongDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PongDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PongDecodeErrorZ clone() { number ret = bindings.CResult_PongDecodeErrorZ_clone(this.ptr); Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PositiveTimestampCreationErrorZ.ts b/ts/structs/Result_PositiveTimestampCreationErrorZ.ts index beb9b74f..8d5dc048 100644 --- a/ts/structs/Result_PositiveTimestampCreationErrorZ.ts +++ b/ts/structs/Result_PositiveTimestampCreationErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { } static Result_PositiveTimestampCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PositiveTimestampCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_PositiveTimestampCreationErrorZ_is_ok(ptr)) { return new Result_PositiveTimestampCreationErrorZ_OK(null, ptr); } else { return new Result_PositiveTimestampCreationErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PositiveTimestampCreationErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PositiveTimestampCreationErrorZ clone() { number ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone(this.ptr); Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PrivateRouteCreationErrorZ.ts b/ts/structs/Result_PrivateRouteCreationErrorZ.ts index 37f9b88c..4cfd7ba0 100644 --- a/ts/structs/Result_PrivateRouteCreationErrorZ.ts +++ b/ts/structs/Result_PrivateRouteCreationErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase { } static Result_PrivateRouteCreationErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PrivateRouteCreationErrorZ_result_ok(ptr)) { + if (bindings.CResult_PrivateRouteCreationErrorZ_is_ok(ptr)) { return new Result_PrivateRouteCreationErrorZ_OK(null, ptr); } else { return new Result_PrivateRouteCreationErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PrivateRouteCreationErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PrivateRouteCreationErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PrivateRouteCreationErrorZ clone() { number ret = bindings.CResult_PrivateRouteCreationErrorZ_clone(this.ptr); Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PublicKeyErrorZ.ts b/ts/structs/Result_PublicKeyErrorZ.ts index 288fb3ee..303de7b7 100644 --- a/ts/structs/Result_PublicKeyErrorZ.ts +++ b/ts/structs/Result_PublicKeyErrorZ.ts @@ -9,7 +9,7 @@ public class Result_PublicKeyErrorZ extends CommonBase { } static Result_PublicKeyErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_PublicKeyErrorZ_result_ok(ptr)) { + if (bindings.CResult_PublicKeyErrorZ_is_ok(ptr)) { return new Result_PublicKeyErrorZ_OK(null, ptr); } else { return new Result_PublicKeyErrorZ_Err(null, ptr); @@ -32,7 +32,7 @@ public class Result_PublicKeyErrorZ extends CommonBase { } public static Result_PublicKeyErrorZ constructor_ok(Uint8Array o) { - number ret = bindings.CResult_PublicKeyErrorZ_ok(o); + number ret = bindings.CResult_PublicKeyErrorZ_ok(InternalUtils.check_arr_len(o, 33)); Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -43,6 +43,16 @@ public class Result_PublicKeyErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_PublicKeyErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_PublicKeyErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_PublicKeyErrorZ clone() { number ret = bindings.CResult_PublicKeyErrorZ_clone(this.ptr); Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts b/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts index 94af8564..77695698 100644 --- a/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts +++ b/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { } static Result_QueryChannelRangeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_QueryChannelRangeDecodeErrorZ_is_ok(ptr)) { return new Result_QueryChannelRangeDecodeErrorZ_OK(null, ptr); } else { return new Result_QueryChannelRangeDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_QueryChannelRangeDecodeErrorZ clone() { number ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone(this.ptr); Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts b/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts index 4031ee1a..7df1f39a 100644 --- a/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts +++ b/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { } static Result_QueryShortChannelIdsDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(ptr)) { return new Result_QueryShortChannelIdsDecodeErrorZ_OK(null, ptr); } else { return new Result_QueryShortChannelIdsDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_QueryShortChannelIdsDecodeErrorZ clone() { number ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone(this.ptr); Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RecoverableSignatureNoneZ.ts b/ts/structs/Result_RecoverableSignatureNoneZ.ts index 0f03325d..413ac731 100644 --- a/ts/structs/Result_RecoverableSignatureNoneZ.ts +++ b/ts/structs/Result_RecoverableSignatureNoneZ.ts @@ -9,7 +9,7 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase { } static Result_RecoverableSignatureNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RecoverableSignatureNoneZ_result_ok(ptr)) { + if (bindings.CResult_RecoverableSignatureNoneZ_is_ok(ptr)) { return new Result_RecoverableSignatureNoneZ_OK(null, ptr); } else { return new Result_RecoverableSignatureNoneZ_Err(null, ptr); @@ -30,7 +30,7 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase { } public static Result_RecoverableSignatureNoneZ constructor_ok(Uint8Array arg) { - number ret = bindings.CResult_RecoverableSignatureNoneZ_ok(arg); + number ret = bindings.CResult_RecoverableSignatureNoneZ_ok(InternalUtils.check_arr_len(arg, 68)); Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -41,6 +41,16 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RecoverableSignatureNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RecoverableSignatureNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_RecoverableSignatureNoneZ clone() { number ret = bindings.CResult_RecoverableSignatureNoneZ_clone(this.ptr); Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts b/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts index d2217cfc..b5af32a4 100644 --- a/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts +++ b/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { } static Result_ReplyChannelRangeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ReplyChannelRangeDecodeErrorZ_is_ok(ptr)) { return new Result_ReplyChannelRangeDecodeErrorZ_OK(null, ptr); } else { return new Result_ReplyChannelRangeDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ReplyChannelRangeDecodeErrorZ clone() { number ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone(this.ptr); Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts b/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts index df3438a8..94670382 100644 --- a/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts +++ b/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { } static Result_ReplyShortChannelIdsEndDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(ptr)) { return new Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(null, ptr); } else { return new Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ReplyShortChannelIdsEndDecodeErrorZ clone() { number ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(this.ptr); Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RevokeAndACKDecodeErrorZ.ts b/ts/structs/Result_RevokeAndACKDecodeErrorZ.ts index 3f99cd28..7764c368 100644 --- a/ts/structs/Result_RevokeAndACKDecodeErrorZ.ts +++ b/ts/structs/Result_RevokeAndACKDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { } static Result_RevokeAndACKDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RevokeAndACKDecodeErrorZ_is_ok(ptr)) { return new Result_RevokeAndACKDecodeErrorZ_OK(null, ptr); } else { return new Result_RevokeAndACKDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RevokeAndACKDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_RevokeAndACKDecodeErrorZ clone() { number ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone(this.ptr); Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteDecodeErrorZ.ts b/ts/structs/Result_RouteDecodeErrorZ.ts index 059b0ee2..99794ce4 100644 --- a/ts/structs/Result_RouteDecodeErrorZ.ts +++ b/ts/structs/Result_RouteDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase { } static Result_RouteDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteDecodeErrorZ_is_ok(ptr)) { return new Result_RouteDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_RouteDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RouteDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RouteDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_RouteDecodeErrorZ clone() { number ret = bindings.CResult_RouteDecodeErrorZ_clone(this.ptr); Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteHintDecodeErrorZ.ts b/ts/structs/Result_RouteHintDecodeErrorZ.ts index 1496e3cf..3b622713 100644 --- a/ts/structs/Result_RouteHintDecodeErrorZ.ts +++ b/ts/structs/Result_RouteHintDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { } static Result_RouteHintDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteHintDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteHintDecodeErrorZ_is_ok(ptr)) { return new Result_RouteHintDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteHintDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RouteHintDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RouteHintDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_RouteHintDecodeErrorZ clone() { number ret = bindings.CResult_RouteHintDecodeErrorZ_clone(this.ptr); Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteHintHopDecodeErrorZ.ts b/ts/structs/Result_RouteHintHopDecodeErrorZ.ts index e6f39c62..35c280c1 100644 --- a/ts/structs/Result_RouteHintHopDecodeErrorZ.ts +++ b/ts/structs/Result_RouteHintHopDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { } static Result_RouteHintHopDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteHintHopDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteHintHopDecodeErrorZ_is_ok(ptr)) { return new Result_RouteHintHopDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteHintHopDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RouteHintHopDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RouteHintHopDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_RouteHintHopDecodeErrorZ clone() { number ret = bindings.CResult_RouteHintHopDecodeErrorZ_clone(this.ptr); Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteHopDecodeErrorZ.ts b/ts/structs/Result_RouteHopDecodeErrorZ.ts index 6cc99b22..a4a3e329 100644 --- a/ts/structs/Result_RouteHopDecodeErrorZ.ts +++ b/ts/structs/Result_RouteHopDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { } static Result_RouteHopDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteHopDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteHopDecodeErrorZ_is_ok(ptr)) { return new Result_RouteHopDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteHopDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RouteHopDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RouteHopDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_RouteHopDecodeErrorZ clone() { number ret = bindings.CResult_RouteHopDecodeErrorZ_clone(this.ptr); Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteLightningErrorZ.ts b/ts/structs/Result_RouteLightningErrorZ.ts index c7ad17f8..33dc74bf 100644 --- a/ts/structs/Result_RouteLightningErrorZ.ts +++ b/ts/structs/Result_RouteLightningErrorZ.ts @@ -9,7 +9,7 @@ public class Result_RouteLightningErrorZ extends CommonBase { } static Result_RouteLightningErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteLightningErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteLightningErrorZ_is_ok(ptr)) { return new Result_RouteLightningErrorZ_OK(null, ptr); } else { return new Result_RouteLightningErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_RouteLightningErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RouteLightningErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RouteLightningErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_RouteLightningErrorZ clone() { number ret = bindings.CResult_RouteLightningErrorZ_clone(this.ptr); Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteParametersDecodeErrorZ.ts b/ts/structs/Result_RouteParametersDecodeErrorZ.ts index 8c8e18b4..78480fe3 100644 --- a/ts/structs/Result_RouteParametersDecodeErrorZ.ts +++ b/ts/structs/Result_RouteParametersDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { } static Result_RouteParametersDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RouteParametersDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RouteParametersDecodeErrorZ_is_ok(ptr)) { return new Result_RouteParametersDecodeErrorZ_OK(null, ptr); } else { return new Result_RouteParametersDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RouteParametersDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RouteParametersDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_RouteParametersDecodeErrorZ clone() { number ret = bindings.CResult_RouteParametersDecodeErrorZ_clone(this.ptr); Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RoutingFeesDecodeErrorZ.ts b/ts/structs/Result_RoutingFeesDecodeErrorZ.ts index 0c08bed4..4c272dfa 100644 --- a/ts/structs/Result_RoutingFeesDecodeErrorZ.ts +++ b/ts/structs/Result_RoutingFeesDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { } static Result_RoutingFeesDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_RoutingFeesDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_RoutingFeesDecodeErrorZ_is_ok(ptr)) { return new Result_RoutingFeesDecodeErrorZ_OK(null, ptr); } else { return new Result_RoutingFeesDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_RoutingFeesDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_RoutingFeesDecodeErrorZ clone() { number ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone(this.ptr); Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ScorerDecodeErrorZ.ts b/ts/structs/Result_ScorerDecodeErrorZ.ts new file mode 100644 index 00000000..843568be --- /dev/null +++ b/ts/structs/Result_ScorerDecodeErrorZ.ts @@ -0,0 +1,66 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +public class Result_ScorerDecodeErrorZ extends CommonBase { + private Result_ScorerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ScorerDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ScorerDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ScorerDecodeErrorZ_is_ok(ptr)) { + return new Result_ScorerDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ScorerDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ScorerDecodeErrorZ_OK extends Result_ScorerDecodeErrorZ { + public final Scorer res; + private Result_ScorerDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + number res = bindings.LDKCResult_ScorerDecodeErrorZ_get_ok(ptr); + const res_hu_conv: Scorer = new Scorer(null, res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_ScorerDecodeErrorZ_Err extends Result_ScorerDecodeErrorZ { + public final DecodeError err; + private Result_ScorerDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + number err = bindings.LDKCResult_ScorerDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + public static Result_ScorerDecodeErrorZ constructor_ok(ScoringParameters o_params) { + number ret = bindings.CResult_ScorerDecodeErrorZ_ok(bindings.Scorer_new(o_params == null ? 0 : o_params.ptr & ~1)); + Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(o_params); +// Due to rust's strict-ownership memory model, in some cases we need to "move" +// an object to pass exclusive ownership to the function being called. +// In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object +// at the FFI layer, creating a new object which Rust can claim ownership of +// However, in some cases (eg here), there is no way to clone an object, and thus +// we actually have to pass full ownership to Rust. +// Thus, after ret_hu_conv call, o_params is reset to null and is now a dummy object. +o_params.ptr = 0; + return ret_hu_conv; + } + + public static Result_ScorerDecodeErrorZ constructor_err(DecodeError e) { + number ret = bindings.CResult_ScorerDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public boolean is_ok() { + boolean ret = bindings.CResult_ScorerDecodeErrorZ_is_ok(this.ptr); + return ret; + } + +} diff --git a/ts/structs/Result_ScoringParametersDecodeErrorZ.ts b/ts/structs/Result_ScoringParametersDecodeErrorZ.ts new file mode 100644 index 00000000..742ed89d --- /dev/null +++ b/ts/structs/Result_ScoringParametersDecodeErrorZ.ts @@ -0,0 +1,57 @@ + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + +public class Result_ScoringParametersDecodeErrorZ extends CommonBase { + private Result_ScoringParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ScoringParametersDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ScoringParametersDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ScoringParametersDecodeErrorZ_is_ok(ptr)) { + return new Result_ScoringParametersDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ScoringParametersDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ScoringParametersDecodeErrorZ_OK extends Result_ScoringParametersDecodeErrorZ { + public final ScoringParameters res; + private Result_ScoringParametersDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + number res = bindings.LDKCResult_ScoringParametersDecodeErrorZ_get_ok(ptr); + const res_hu_conv: ScoringParameters = new ScoringParameters(null, res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_ScoringParametersDecodeErrorZ_Err extends Result_ScoringParametersDecodeErrorZ { + public final DecodeError err; + private Result_ScoringParametersDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + number err = bindings.LDKCResult_ScoringParametersDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + public static Result_ScoringParametersDecodeErrorZ constructor_ok(number o_base_penalty_msat_arg, number o_failure_penalty_msat_arg, number o_failure_penalty_half_life_arg) { + number ret = bindings.CResult_ScoringParametersDecodeErrorZ_ok(bindings.ScoringParameters_new(o_base_penalty_msat_arg, o_failure_penalty_msat_arg, o_failure_penalty_half_life_arg)); + Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_ScoringParametersDecodeErrorZ constructor_err(DecodeError e) { + number ret = bindings.CResult_ScoringParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public boolean is_ok() { + boolean ret = bindings.CResult_ScoringParametersDecodeErrorZ_is_ok(this.ptr); + return ret; + } + +} diff --git a/ts/structs/Result_SecretKeyErrorZ.ts b/ts/structs/Result_SecretKeyErrorZ.ts index 817da050..ae21d631 100644 --- a/ts/structs/Result_SecretKeyErrorZ.ts +++ b/ts/structs/Result_SecretKeyErrorZ.ts @@ -9,7 +9,7 @@ public class Result_SecretKeyErrorZ extends CommonBase { } static Result_SecretKeyErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SecretKeyErrorZ_result_ok(ptr)) { + if (bindings.CResult_SecretKeyErrorZ_is_ok(ptr)) { return new Result_SecretKeyErrorZ_OK(null, ptr); } else { return new Result_SecretKeyErrorZ_Err(null, ptr); @@ -32,7 +32,7 @@ public class Result_SecretKeyErrorZ extends CommonBase { } public static Result_SecretKeyErrorZ constructor_ok(Uint8Array o) { - number ret = bindings.CResult_SecretKeyErrorZ_ok(o); + number ret = bindings.CResult_SecretKeyErrorZ_ok(InternalUtils.check_arr_len(o, 32)); Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -43,4 +43,9 @@ public class Result_SecretKeyErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_SecretKeyErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_ShutdownDecodeErrorZ.ts b/ts/structs/Result_ShutdownDecodeErrorZ.ts index 98c30c01..6eaa72bc 100644 --- a/ts/structs/Result_ShutdownDecodeErrorZ.ts +++ b/ts/structs/Result_ShutdownDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { } static Result_ShutdownDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ShutdownDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ShutdownDecodeErrorZ_is_ok(ptr)) { return new Result_ShutdownDecodeErrorZ_OK(null, ptr); } else { return new Result_ShutdownDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ShutdownDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ShutdownDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ShutdownDecodeErrorZ clone() { number ret = bindings.CResult_ShutdownDecodeErrorZ_clone(this.ptr); Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ShutdownScriptDecodeErrorZ.ts b/ts/structs/Result_ShutdownScriptDecodeErrorZ.ts index b2ec0a92..067d8ffd 100644 --- a/ts/structs/Result_ShutdownScriptDecodeErrorZ.ts +++ b/ts/structs/Result_ShutdownScriptDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { } static Result_ShutdownScriptDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ShutdownScriptDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_ShutdownScriptDecodeErrorZ_is_ok(ptr)) { return new Result_ShutdownScriptDecodeErrorZ_OK(null, ptr); } else { return new Result_ShutdownScriptDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ShutdownScriptDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ShutdownScriptDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_ShutdownScriptDecodeErrorZ clone() { number ret = bindings.CResult_ShutdownScriptDecodeErrorZ_clone(this.ptr); Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ShutdownScriptInvalidShutdownScriptZ.ts b/ts/structs/Result_ShutdownScriptInvalidShutdownScriptZ.ts index 670190b8..7fae6c5c 100644 --- a/ts/structs/Result_ShutdownScriptInvalidShutdownScriptZ.ts +++ b/ts/structs/Result_ShutdownScriptInvalidShutdownScriptZ.ts @@ -9,7 +9,7 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { } static Result_ShutdownScriptInvalidShutdownScriptZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(ptr)) { + if (bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(ptr)) { return new Result_ShutdownScriptInvalidShutdownScriptZ_OK(null, ptr); } else { return new Result_ShutdownScriptInvalidShutdownScriptZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(this.ptr); + return ret; + } + public Result_ShutdownScriptInvalidShutdownScriptZ clone() { number ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone(this.ptr); Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_SiPrefixNoneZ.ts b/ts/structs/Result_SiPrefixNoneZ.ts index 0bb1c236..950fe420 100644 --- a/ts/structs/Result_SiPrefixNoneZ.ts +++ b/ts/structs/Result_SiPrefixNoneZ.ts @@ -9,7 +9,7 @@ public class Result_SiPrefixNoneZ extends CommonBase { } static Result_SiPrefixNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SiPrefixNoneZ_result_ok(ptr)) { + if (bindings.CResult_SiPrefixNoneZ_is_ok(ptr)) { return new Result_SiPrefixNoneZ_OK(null, ptr); } else { return new Result_SiPrefixNoneZ_Err(null, ptr); @@ -41,6 +41,16 @@ public class Result_SiPrefixNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_SiPrefixNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_SiPrefixNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_SiPrefixNoneZ clone() { number ret = bindings.CResult_SiPrefixNoneZ_clone(this.ptr); Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_SignDecodeErrorZ.ts b/ts/structs/Result_SignDecodeErrorZ.ts index ea9586c4..ff486f6c 100644 --- a/ts/structs/Result_SignDecodeErrorZ.ts +++ b/ts/structs/Result_SignDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_SignDecodeErrorZ extends CommonBase { } static Result_SignDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SignDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_SignDecodeErrorZ_is_ok(ptr)) { return new Result_SignDecodeErrorZ_OK(null, ptr); } else { return new Result_SignDecodeErrorZ_Err(null, ptr); @@ -50,6 +50,16 @@ public class Result_SignDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_SignDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_SignDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_SignDecodeErrorZ clone() { number ret = bindings.CResult_SignDecodeErrorZ_clone(this.ptr); Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_SignatureNoneZ.ts b/ts/structs/Result_SignatureNoneZ.ts index 5297299e..7f1c5a6a 100644 --- a/ts/structs/Result_SignatureNoneZ.ts +++ b/ts/structs/Result_SignatureNoneZ.ts @@ -9,7 +9,7 @@ public class Result_SignatureNoneZ extends CommonBase { } static Result_SignatureNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SignatureNoneZ_result_ok(ptr)) { + if (bindings.CResult_SignatureNoneZ_is_ok(ptr)) { return new Result_SignatureNoneZ_OK(null, ptr); } else { return new Result_SignatureNoneZ_Err(null, ptr); @@ -30,7 +30,7 @@ public class Result_SignatureNoneZ extends CommonBase { } public static Result_SignatureNoneZ constructor_ok(Uint8Array o) { - number ret = bindings.CResult_SignatureNoneZ_ok(o); + number ret = bindings.CResult_SignatureNoneZ_ok(InternalUtils.check_arr_len(o, 64)); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -41,6 +41,16 @@ public class Result_SignatureNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_SignatureNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_SignatureNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_SignatureNoneZ clone() { number ret = bindings.CResult_SignatureNoneZ_clone(this.ptr); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_SignedRawInvoiceNoneZ.ts b/ts/structs/Result_SignedRawInvoiceNoneZ.ts index 5c3bdf2b..6b3da462 100644 --- a/ts/structs/Result_SignedRawInvoiceNoneZ.ts +++ b/ts/structs/Result_SignedRawInvoiceNoneZ.ts @@ -9,7 +9,7 @@ public class Result_SignedRawInvoiceNoneZ extends CommonBase { } static Result_SignedRawInvoiceNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SignedRawInvoiceNoneZ_result_ok(ptr)) { + if (bindings.CResult_SignedRawInvoiceNoneZ_is_ok(ptr)) { return new Result_SignedRawInvoiceNoneZ_OK(null, ptr); } else { return new Result_SignedRawInvoiceNoneZ_Err(null, ptr); @@ -44,6 +44,16 @@ public class Result_SignedRawInvoiceNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_SignedRawInvoiceNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_SignedRawInvoiceNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_SignedRawInvoiceNoneZ clone() { number ret = bindings.CResult_SignedRawInvoiceNoneZ_clone(this.ptr); Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts b/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts index dda6dbff..37e33590 100644 --- a/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts +++ b/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { } static Result_SpendableOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(ptr)) { return new Result_SpendableOutputDescriptorDecodeErrorZ_OK(null, ptr); } else { return new Result_SpendableOutputDescriptorDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_SpendableOutputDescriptorDecodeErrorZ clone() { number ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(this.ptr); Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.ts b/ts/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.ts index c798e151..3899f62e 100644 --- a/ts/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.ts +++ b/ts/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase } static Result_StaticPaymentOutputDescriptorDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(ptr)) { return new Result_StaticPaymentOutputDescriptorDecodeErrorZ_OK(null, ptr); } else { return new Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_StaticPaymentOutputDescriptorDecodeErrorZ clone() { number ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr); Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_StringErrorZ.ts b/ts/structs/Result_StringErrorZ.ts index e5c9da4c..b482d250 100644 --- a/ts/structs/Result_StringErrorZ.ts +++ b/ts/structs/Result_StringErrorZ.ts @@ -9,7 +9,7 @@ public class Result_StringErrorZ extends CommonBase { } static Result_StringErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_StringErrorZ_result_ok(ptr)) { + if (bindings.CResult_StringErrorZ_is_ok(ptr)) { return new Result_StringErrorZ_OK(null, ptr); } else { return new Result_StringErrorZ_Err(null, ptr); @@ -43,4 +43,9 @@ public class Result_StringErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_StringErrorZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_TransactionNoneZ.ts b/ts/structs/Result_TransactionNoneZ.ts index 1e51b2e2..b1ccf6b7 100644 --- a/ts/structs/Result_TransactionNoneZ.ts +++ b/ts/structs/Result_TransactionNoneZ.ts @@ -9,7 +9,7 @@ public class Result_TransactionNoneZ extends CommonBase { } static Result_TransactionNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TransactionNoneZ_result_ok(ptr)) { + if (bindings.CResult_TransactionNoneZ_is_ok(ptr)) { return new Result_TransactionNoneZ_OK(null, ptr); } else { return new Result_TransactionNoneZ_Err(null, ptr); @@ -41,6 +41,16 @@ public class Result_TransactionNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_TransactionNoneZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_TransactionNoneZ_clone_ptr(this.ptr); + return ret; + } + public Result_TransactionNoneZ clone() { number ret = bindings.CResult_TransactionNoneZ_clone(this.ptr); Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_TrustedClosingTransactionNoneZ.ts b/ts/structs/Result_TrustedClosingTransactionNoneZ.ts index 31a100d1..4698edfc 100644 --- a/ts/structs/Result_TrustedClosingTransactionNoneZ.ts +++ b/ts/structs/Result_TrustedClosingTransactionNoneZ.ts @@ -9,7 +9,7 @@ public class Result_TrustedClosingTransactionNoneZ extends CommonBase { } static Result_TrustedClosingTransactionNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TrustedClosingTransactionNoneZ_result_ok(ptr)) { + if (bindings.CResult_TrustedClosingTransactionNoneZ_is_ok(ptr)) { return new Result_TrustedClosingTransactionNoneZ_OK(null, ptr); } else { return new Result_TrustedClosingTransactionNoneZ_Err(null, ptr); @@ -53,4 +53,9 @@ public class Result_TrustedClosingTransactionNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_TrustedClosingTransactionNoneZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts b/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts index 7a29641e..406c6d76 100644 --- a/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts +++ b/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts @@ -9,7 +9,7 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { } static Result_TrustedCommitmentTransactionNoneZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(ptr)) { + if (bindings.CResult_TrustedCommitmentTransactionNoneZ_is_ok(ptr)) { return new Result_TrustedCommitmentTransactionNoneZ_OK(null, ptr); } else { return new Result_TrustedCommitmentTransactionNoneZ_Err(null, ptr); @@ -53,4 +53,9 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_is_ok(this.ptr); + return ret; + } + } diff --git a/ts/structs/Result_TxCreationKeysDecodeErrorZ.ts b/ts/structs/Result_TxCreationKeysDecodeErrorZ.ts index 079c5132..674477cd 100644 --- a/ts/structs/Result_TxCreationKeysDecodeErrorZ.ts +++ b/ts/structs/Result_TxCreationKeysDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { } static Result_TxCreationKeysDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TxCreationKeysDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_TxCreationKeysDecodeErrorZ_is_ok(ptr)) { return new Result_TxCreationKeysDecodeErrorZ_OK(null, ptr); } else { return new Result_TxCreationKeysDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_TxCreationKeysDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_TxCreationKeysDecodeErrorZ clone() { number ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone(this.ptr); Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_TxCreationKeysErrorZ.ts b/ts/structs/Result_TxCreationKeysErrorZ.ts index efcb2f49..49666976 100644 --- a/ts/structs/Result_TxCreationKeysErrorZ.ts +++ b/ts/structs/Result_TxCreationKeysErrorZ.ts @@ -9,7 +9,7 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { } static Result_TxCreationKeysErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TxCreationKeysErrorZ_result_ok(ptr)) { + if (bindings.CResult_TxCreationKeysErrorZ_is_ok(ptr)) { return new Result_TxCreationKeysErrorZ_OK(null, ptr); } else { return new Result_TxCreationKeysErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_TxCreationKeysErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_TxCreationKeysErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_TxCreationKeysErrorZ clone() { number ret = bindings.CResult_TxCreationKeysErrorZ_clone(this.ptr); Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_TxOutAccessErrorZ.ts b/ts/structs/Result_TxOutAccessErrorZ.ts index f72042f9..fe6a0a7f 100644 --- a/ts/structs/Result_TxOutAccessErrorZ.ts +++ b/ts/structs/Result_TxOutAccessErrorZ.ts @@ -9,7 +9,7 @@ public class Result_TxOutAccessErrorZ extends CommonBase { } static Result_TxOutAccessErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_TxOutAccessErrorZ_result_ok(ptr)) { + if (bindings.CResult_TxOutAccessErrorZ_is_ok(ptr)) { return new Result_TxOutAccessErrorZ_OK(null, ptr); } else { return new Result_TxOutAccessErrorZ_Err(null, ptr); @@ -45,6 +45,16 @@ public class Result_TxOutAccessErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_TxOutAccessErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_TxOutAccessErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_TxOutAccessErrorZ clone() { number ret = bindings.CResult_TxOutAccessErrorZ_clone(this.ptr); Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts b/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts index 958a7dd4..55f53adf 100644 --- a/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { } static Result_UnsignedChannelAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(ptr)) { return new Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(null, ptr); } else { return new Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_UnsignedChannelAnnouncementDecodeErrorZ clone() { number ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(this.ptr); Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts b/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts index 979f6b49..eeaf83dc 100644 --- a/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { } static Result_UnsignedChannelUpdateDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(ptr)) { return new Result_UnsignedChannelUpdateDecodeErrorZ_OK(null, ptr); } else { return new Result_UnsignedChannelUpdateDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_UnsignedChannelUpdateDecodeErrorZ clone() { number ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone(this.ptr); Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts b/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts index 0dae7427..d5e2c38c 100644 --- a/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { } static Result_UnsignedNodeAnnouncementDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(ptr)) { return new Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(null, ptr); } else { return new Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_UnsignedNodeAnnouncementDecodeErrorZ clone() { number ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(this.ptr); Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.ts b/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.ts index 9392c197..e0cd7e7e 100644 --- a/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { } static Result_UpdateAddHTLCDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateAddHTLCDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateAddHTLCDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateAddHTLCDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_UpdateAddHTLCDecodeErrorZ clone() { number ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone(this.ptr); Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.ts b/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.ts index 7be6bd51..20f471a6 100644 --- a/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { } static Result_UpdateFailHTLCDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateFailHTLCDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateFailHTLCDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateFailHTLCDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_UpdateFailHTLCDecodeErrorZ clone() { number ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone(this.ptr); Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.ts b/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.ts index 7777a8a0..4066e0b5 100644 --- a/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { } static Result_UpdateFailMalformedHTLCDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_UpdateFailMalformedHTLCDecodeErrorZ clone() { number ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(this.ptr); Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateFeeDecodeErrorZ.ts b/ts/structs/Result_UpdateFeeDecodeErrorZ.ts index a7488f36..09fbb333 100644 --- a/ts/structs/Result_UpdateFeeDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateFeeDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { } static Result_UpdateFeeDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateFeeDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateFeeDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateFeeDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateFeeDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateFeeDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_UpdateFeeDecodeErrorZ clone() { number ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone(this.ptr); Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.ts b/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.ts index f054b92f..7104ca83 100644 --- a/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.ts +++ b/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.ts @@ -9,7 +9,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { } static Result_UpdateFulfillHTLCDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(ptr)) { + if (bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(ptr)) { return new Result_UpdateFulfillHTLCDecodeErrorZ_OK(null, ptr); } else { return new Result_UpdateFulfillHTLCDecodeErrorZ_Err(null, ptr); @@ -49,6 +49,16 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_UpdateFulfillHTLCDecodeErrorZ clone() { number ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone(this.ptr); Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result__u832APIErrorZ.ts b/ts/structs/Result__u832APIErrorZ.ts index f3105277..bd0a59b0 100644 --- a/ts/structs/Result__u832APIErrorZ.ts +++ b/ts/structs/Result__u832APIErrorZ.ts @@ -9,7 +9,7 @@ public class Result__u832APIErrorZ extends CommonBase { } static Result__u832APIErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult__u832APIErrorZ_result_ok(ptr)) { + if (bindings.CResult__u832APIErrorZ_is_ok(ptr)) { return new Result__u832APIErrorZ_OK(null, ptr); } else { return new Result__u832APIErrorZ_Err(null, ptr); @@ -35,7 +35,7 @@ public class Result__u832APIErrorZ extends CommonBase { } public static Result__u832APIErrorZ constructor_ok(Uint8Array o) { - number ret = bindings.CResult__u832APIErrorZ_ok(o); + number ret = bindings.CResult__u832APIErrorZ_ok(InternalUtils.check_arr_len(o, 32)); Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -46,6 +46,16 @@ public class Result__u832APIErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult__u832APIErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult__u832APIErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result__u832APIErrorZ clone() { number ret = bindings.CResult__u832APIErrorZ_clone(this.ptr); Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_boolLightningErrorZ.ts b/ts/structs/Result_boolLightningErrorZ.ts index 803ef06d..021bd872 100644 --- a/ts/structs/Result_boolLightningErrorZ.ts +++ b/ts/structs/Result_boolLightningErrorZ.ts @@ -9,7 +9,7 @@ public class Result_boolLightningErrorZ extends CommonBase { } static Result_boolLightningErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_boolLightningErrorZ_result_ok(ptr)) { + if (bindings.CResult_boolLightningErrorZ_is_ok(ptr)) { return new Result_boolLightningErrorZ_OK(null, ptr); } else { return new Result_boolLightningErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_boolLightningErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_boolLightningErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_boolLightningErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_boolLightningErrorZ clone() { number ret = bindings.CResult_boolLightningErrorZ_clone(this.ptr); Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_boolPeerHandleErrorZ.ts b/ts/structs/Result_boolPeerHandleErrorZ.ts index 337145dc..2d8e096a 100644 --- a/ts/structs/Result_boolPeerHandleErrorZ.ts +++ b/ts/structs/Result_boolPeerHandleErrorZ.ts @@ -9,7 +9,7 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { } static Result_boolPeerHandleErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_boolPeerHandleErrorZ_result_ok(ptr)) { + if (bindings.CResult_boolPeerHandleErrorZ_is_ok(ptr)) { return new Result_boolPeerHandleErrorZ_OK(null, ptr); } else { return new Result_boolPeerHandleErrorZ_Err(null, ptr); @@ -46,6 +46,16 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { return ret_hu_conv; } + public boolean is_ok() { + boolean ret = bindings.CResult_boolPeerHandleErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_boolPeerHandleErrorZ_clone_ptr(this.ptr); + return ret; + } + public Result_boolPeerHandleErrorZ clone() { number ret = bindings.CResult_boolPeerHandleErrorZ_clone(this.ptr); Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/RetryAttempts.ts b/ts/structs/RetryAttempts.ts index a01632d8..d844d6ed 100644 --- a/ts/structs/RetryAttempts.ts +++ b/ts/structs/RetryAttempts.ts @@ -34,6 +34,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.RetryAttempts_clone_ptr(this.ptr); + return ret; + } + public RetryAttempts clone() { number ret = bindings.RetryAttempts_clone(this.ptr); const ret_hu_conv: RetryAttempts = new RetryAttempts(null, ret); diff --git a/ts/structs/RevokeAndACK.ts b/ts/structs/RevokeAndACK.ts index d5212469..b4720403 100644 --- a/ts/structs/RevokeAndACK.ts +++ b/ts/structs/RevokeAndACK.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.RevokeAndACK_set_channel_id(this.ptr, val); + bindings.RevokeAndACK_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_per_commitment_secret() { @@ -33,7 +33,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_per_commitment_secret(Uint8Array val) { - bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, val); + bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_next_per_commitment_point() { @@ -42,16 +42,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_next_per_commitment_point(Uint8Array val) { - bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, val); + bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public static RevokeAndACK constructor_new(Uint8Array channel_id_arg, Uint8Array per_commitment_secret_arg, Uint8Array next_per_commitment_point_arg) { - number ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg); + number ret = bindings.RevokeAndACK_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(per_commitment_secret_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33)); const ret_hu_conv: RevokeAndACK = new RevokeAndACK(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.RevokeAndACK_clone_ptr(this.ptr); + return ret; + } + public RevokeAndACK clone() { number ret = bindings.RevokeAndACK_clone(this.ptr); const ret_hu_conv: RevokeAndACK = new RevokeAndACK(null, ret); diff --git a/ts/structs/Route.ts b/ts/structs/Route.ts index e0810374..0335254b 100644 --- a/ts/structs/Route.ts +++ b/ts/structs/Route.ts @@ -57,6 +57,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.Route_clone_ptr(this.ptr); + return ret; + } + public Route clone() { number ret = bindings.Route_clone(this.ptr); const ret_hu_conv: Route = new Route(null, ret); diff --git a/ts/structs/RouteHint.ts b/ts/structs/RouteHint.ts index dfd72325..05604200 100644 --- a/ts/structs/RouteHint.ts +++ b/ts/structs/RouteHint.ts @@ -41,6 +41,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.RouteHint_clone_ptr(this.ptr); + return ret; + } + public RouteHint clone() { number ret = bindings.RouteHint_clone(this.ptr); const ret_hu_conv: RouteHint = new RouteHint(null, ret); diff --git a/ts/structs/RouteHintHop.ts b/ts/structs/RouteHintHop.ts index dc25be93..a211023c 100644 --- a/ts/structs/RouteHintHop.ts +++ b/ts/structs/RouteHintHop.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_src_node_id(Uint8Array val) { - bindings.RouteHintHop_set_src_node_id(this.ptr, val); + bindings.RouteHintHop_set_src_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); } public number get_short_channel_id() { @@ -79,12 +79,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static RouteHintHop constructor_new(Uint8Array src_node_id_arg, number short_channel_id_arg, RoutingFees fees_arg, number cltv_expiry_delta_arg, Option_u64Z htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg) { - number ret = bindings.RouteHintHop_new(src_node_id_arg, short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); + number ret = bindings.RouteHintHop_new(InternalUtils.check_arr_len(src_node_id_arg, 33), short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); const ret_hu_conv: RouteHintHop = new RouteHintHop(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.RouteHintHop_clone_ptr(this.ptr); + return ret; + } + public RouteHintHop clone() { number ret = bindings.RouteHintHop_clone(this.ptr); const ret_hu_conv: RouteHintHop = new RouteHintHop(null, ret); diff --git a/ts/structs/RouteHop.ts b/ts/structs/RouteHop.ts index b3ba3d73..af9e0616 100644 --- a/ts/structs/RouteHop.ts +++ b/ts/structs/RouteHop.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_pubkey(Uint8Array val) { - bindings.RouteHop_set_pubkey(this.ptr, val); + bindings.RouteHop_set_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } public NodeFeatures get_node_features() { @@ -77,12 +77,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static RouteHop constructor_new(Uint8Array pubkey_arg, NodeFeatures node_features_arg, number short_channel_id_arg, ChannelFeatures channel_features_arg, number fee_msat_arg, number cltv_expiry_delta_arg) { - number ret = bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg); + number ret = bindings.RouteHop_new(InternalUtils.check_arr_len(pubkey_arg, 33), node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg); const ret_hu_conv: RouteHop = new RouteHop(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.RouteHop_clone_ptr(this.ptr); + return ret; + } + public RouteHop clone() { number ret = bindings.RouteHop_clone(this.ptr); const ret_hu_conv: RouteHop = new RouteHop(null, ret); diff --git a/ts/structs/RouteParameters.ts b/ts/structs/RouteParameters.ts index fa67e170..304e3190 100644 --- a/ts/structs/RouteParameters.ts +++ b/ts/structs/RouteParameters.ts @@ -54,6 +54,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.RouteParameters_clone_ptr(this.ptr); + return ret; + } + public RouteParameters clone() { number ret = bindings.RouteParameters_clone(this.ptr); const ret_hu_conv: RouteParameters = new RouteParameters(null, ret); diff --git a/ts/structs/Router.ts b/ts/structs/Router.ts index 4b7dd593..98467779 100644 --- a/ts/structs/Router.ts +++ b/ts/structs/Router.ts @@ -44,7 +44,7 @@ import * as bindings from '../bindings' // TODO: figure out location Score ret_hu_conv = new Score(null, scorer); ret_hu_conv.ptrs_to.add(this); Result_RouteLightningErrorZ ret = arg.find_route(payer, params_hu_conv, first_hops_conv_16_arr, ret_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -63,7 +63,7 @@ import * as bindings from '../bindings' // TODO: figure out location held: Router; } public Result_RouteLightningErrorZ find_route(Uint8Array payer, RouteParameters params, ChannelDetails[] first_hops, Score scorer) { - number ret = bindings.Router_find_route(this.ptr, payer, params == null ? 0 : params.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new) : null, scorer == null ? 0 : scorer.ptr); + number ret = bindings.Router_find_route(this.ptr, InternalUtils.check_arr_len(payer, 33), params == null ? 0 : params.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new) : null, scorer == null ? 0 : scorer.ptr); Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(params); for (ChannelDetails first_hops_conv_16: first_hops) { this.ptrs_to.add(first_hops_conv_16); }; diff --git a/ts/structs/RoutingFees.ts b/ts/structs/RoutingFees.ts index 2fb461a4..494a0fb1 100644 --- a/ts/structs/RoutingFees.ts +++ b/ts/structs/RoutingFees.ts @@ -49,6 +49,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.RoutingFees_clone_ptr(this.ptr); + return ret; + } + public RoutingFees clone() { number ret = bindings.RoutingFees_clone(this.ptr); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); diff --git a/ts/structs/RoutingMessageHandler.ts b/ts/structs/RoutingMessageHandler.ts index c83f25ab..263b67c0 100644 --- a/ts/structs/RoutingMessageHandler.ts +++ b/ts/structs/RoutingMessageHandler.ts @@ -36,33 +36,33 @@ import * as bindings from '../bindings' // TODO: figure out location handle_node_announcement (msg: number): number { const msg_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, msg); Result_boolLightningErrorZ ret = arg.handle_node_announcement(msg_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, handle_channel_announcement (msg: number): number { const msg_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, msg); Result_boolLightningErrorZ ret = arg.handle_channel_announcement(msg_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, handle_channel_update (msg: number): number { const msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, msg); Result_boolLightningErrorZ ret = arg.handle_channel_update(msg_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, get_next_channel_announcements (starting_point: number, batch_amount: number): number[] { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[] ret = arg.get_next_channel_announcements(starting_point, batch_amount); - result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_59 -> ret_conv_59 != null ? ret_conv_59.ptr : 0).toArray(number[]::new) : null; + result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_59 -> ret_conv_59 == null ? 0 : ret_conv_59.clone_ptr()).toArray(number[]::new) : null; return result; }, get_next_node_announcements (starting_point: Uint8Array, batch_amount: number): number[] { NodeAnnouncement[] ret = arg.get_next_node_announcements(starting_point, batch_amount); - result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.ptr & ~1).toArray(number[]::new) : null; + result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.clone_ptr()).toArray(number[]::new) : null; return result; }, @@ -75,7 +75,7 @@ import * as bindings from '../bindings' // TODO: figure out location const msg_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, msg); msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_reply_channel_range(their_node_id, msg_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -83,7 +83,7 @@ import * as bindings from '../bindings' // TODO: figure out location const msg_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, msg); msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_reply_short_channel_ids_end(their_node_id, msg_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -91,7 +91,7 @@ import * as bindings from '../bindings' // TODO: figure out location const msg_hu_conv: QueryChannelRange = new QueryChannelRange(null, msg); msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_query_channel_range(their_node_id, msg_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -99,7 +99,7 @@ import * as bindings from '../bindings' // TODO: figure out location const msg_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, msg); msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_query_short_channel_ids(their_node_id, msg_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -160,7 +160,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public NodeAnnouncement[] get_next_node_announcements(Uint8Array starting_point, number batch_amount) { - number[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, starting_point, batch_amount); + number[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, InternalUtils.check_arr_len(starting_point, 33), batch_amount); NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret.length]; for (int s = 0; s < ret.length; s++) { number ret_conv_18 = ret[s]; @@ -172,30 +172,30 @@ import * as bindings from '../bindings' // TODO: figure out location } public void sync_routing_table(Uint8Array their_node_id, Init init) { - bindings.RoutingMessageHandler_sync_routing_table(this.ptr, their_node_id, init == null ? 0 : init.ptr & ~1); + bindings.RoutingMessageHandler_sync_routing_table(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr & ~1); this.ptrs_to.add(init); } public Result_NoneLightningErrorZ handle_reply_channel_range(Uint8Array their_node_id, ReplyChannelRange msg) { - number ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(Uint8Array their_node_id, ReplyShortChannelIdsEnd msg) { - number ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public Result_NoneLightningErrorZ handle_query_channel_range(Uint8Array their_node_id, QueryChannelRange msg) { - number ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public Result_NoneLightningErrorZ handle_query_short_channel_ids(Uint8Array their_node_id, QueryShortChannelIds msg) { - number ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/Sha256.ts b/ts/structs/Sha256.ts index 2f97904c..dd23a098 100644 --- a/ts/structs/Sha256.ts +++ b/ts/structs/Sha256.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.Sha256_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.Sha256_clone_ptr(this.ptr); + return ret; + } + public Sha256 clone() { number ret = bindings.Sha256_clone(this.ptr); const ret_hu_conv: Sha256 = new Sha256(null, ret); diff --git a/ts/structs/Shutdown.ts b/ts/structs/Shutdown.ts index 3c50548b..dd73d5bd 100644 --- a/ts/structs/Shutdown.ts +++ b/ts/structs/Shutdown.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.Shutdown_set_channel_id(this.ptr, val); + bindings.Shutdown_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public Uint8Array get_scriptpubkey() { @@ -37,12 +37,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static Shutdown constructor_new(Uint8Array channel_id_arg, Uint8Array scriptpubkey_arg) { - number ret = bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg); + number ret = bindings.Shutdown_new(InternalUtils.check_arr_len(channel_id_arg, 32), scriptpubkey_arg); const ret_hu_conv: Shutdown = new Shutdown(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.Shutdown_clone_ptr(this.ptr); + return ret; + } + public Shutdown clone() { number ret = bindings.Shutdown_clone(this.ptr); const ret_hu_conv: Shutdown = new Shutdown(null, ret); diff --git a/ts/structs/ShutdownScript.ts b/ts/structs/ShutdownScript.ts index c035f7c9..e1da61d7 100644 --- a/ts/structs/ShutdownScript.ts +++ b/ts/structs/ShutdownScript.ts @@ -18,6 +18,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ShutdownScript_free(this.ptr); } } + public number clone_ptr() { + number ret = bindings.ShutdownScript_clone_ptr(this.ptr); + return ret; + } + public ShutdownScript clone() { number ret = bindings.ShutdownScript_clone(this.ptr); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); @@ -37,14 +42,14 @@ import * as bindings from '../bindings' // TODO: figure out location } public static ShutdownScript constructor_new_p2wpkh(Uint8Array pubkey_hash) { - number ret = bindings.ShutdownScript_new_p2wpkh(pubkey_hash); + number ret = bindings.ShutdownScript_new_p2wpkh(InternalUtils.check_arr_len(pubkey_hash, 20)); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } public static ShutdownScript constructor_new_p2wsh(Uint8Array script_hash) { - number ret = bindings.ShutdownScript_new_p2wsh(script_hash); + number ret = bindings.ShutdownScript_new_p2wsh(InternalUtils.check_arr_len(script_hash, 32)); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/Sign.ts b/ts/structs/Sign.ts index e99c5818..1d99ab39 100644 --- a/ts/structs/Sign.ts +++ b/ts/structs/Sign.ts @@ -15,7 +15,7 @@ import * as bindings from '../bindings' // TODO: figure out location this.bindings_instance = null; } else { // TODO: private constructor instantiation - super(bindings.LDKSign_new(arg, baseSign, pubkeys == null ? 0 : pubkeys.ptr & ~1)); + super(bindings.LDKSign_new(arg, baseSign, pubkeys == null ? 0 : pubkeys.clone_ptr())); this.ptrs_to.push(arg); this.ptrs_to.push(baseSign); @@ -57,6 +57,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.Sign_clone_ptr(this.ptr); + return ret; + } + public Sign clone() { number ret = bindings.Sign_clone(this.ptr); Sign ret_hu_conv = new Sign(null, ret); diff --git a/ts/structs/SignOrCreationError.ts b/ts/structs/SignOrCreationError.ts index 27312a3a..d2e1e36b 100644 --- a/ts/structs/SignOrCreationError.ts +++ b/ts/structs/SignOrCreationError.ts @@ -32,6 +32,11 @@ export class CreationError extends SignOrCreationError { this.creation_error = obj.creation_error; } } + public number clone_ptr() { + number ret = bindings.SignOrCreationError_clone_ptr(this.ptr); + return ret; + } + public SignOrCreationError clone() { number ret = bindings.SignOrCreationError_clone(this.ptr); SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret); diff --git a/ts/structs/SignedRawInvoice.ts b/ts/structs/SignedRawInvoice.ts index 53f73549..22f2b59e 100644 --- a/ts/structs/SignedRawInvoice.ts +++ b/ts/structs/SignedRawInvoice.ts @@ -24,6 +24,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.SignedRawInvoice_clone_ptr(this.ptr); + return ret; + } + public SignedRawInvoice clone() { number ret = bindings.SignedRawInvoice_clone(this.ptr); const ret_hu_conv: SignedRawInvoice = new SignedRawInvoice(null, ret); diff --git a/ts/structs/SocketDescriptor.ts b/ts/structs/SocketDescriptor.ts index a2207ae7..d9439255 100644 --- a/ts/structs/SocketDescriptor.ts +++ b/ts/structs/SocketDescriptor.ts @@ -84,6 +84,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.SocketDescriptor_clone_ptr(this.ptr); + return ret; + } + public SocketDescriptor clone() { number ret = bindings.SocketDescriptor_clone(this.ptr); SocketDescriptor ret_hu_conv = new SocketDescriptor(null, ret); diff --git a/ts/structs/SpendableOutputDescriptor.ts b/ts/structs/SpendableOutputDescriptor.ts index bdd9f659..f0758a28 100644 --- a/ts/structs/SpendableOutputDescriptor.ts +++ b/ts/structs/SpendableOutputDescriptor.ts @@ -57,6 +57,11 @@ export class StaticPaymentOutput extends SpendableOutputDescriptor { this.static_payment_output = static_payment_output_hu_conv; } } + public number clone_ptr() { + number ret = bindings.SpendableOutputDescriptor_clone_ptr(this.ptr); + return ret; + } + public SpendableOutputDescriptor clone() { number ret = bindings.SpendableOutputDescriptor_clone(this.ptr); SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret); diff --git a/ts/structs/StaticPaymentOutputDescriptor.ts b/ts/structs/StaticPaymentOutputDescriptor.ts index 62428567..9af18ea3 100644 --- a/ts/structs/StaticPaymentOutputDescriptor.ts +++ b/ts/structs/StaticPaymentOutputDescriptor.ts @@ -39,7 +39,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_keys_id(Uint8Array val) { - bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val); + bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_channel_value_satoshis() { @@ -52,12 +52,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static StaticPaymentOutputDescriptor constructor_new(OutPoint outpoint_arg, TxOut output_arg, Uint8Array channel_keys_id_arg, number channel_value_satoshis_arg) { - number ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, output_arg.ptr, channel_keys_id_arg, channel_value_satoshis_arg); + number ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, output_arg.ptr, InternalUtils.check_arr_len(channel_keys_id_arg, 32), channel_value_satoshis_arg); const ret_hu_conv: StaticPaymentOutputDescriptor = new StaticPaymentOutputDescriptor(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.StaticPaymentOutputDescriptor_clone_ptr(this.ptr); + return ret; + } + public StaticPaymentOutputDescriptor clone() { number ret = bindings.StaticPaymentOutputDescriptor_clone(this.ptr); const ret_hu_conv: StaticPaymentOutputDescriptor = new StaticPaymentOutputDescriptor(null, ret); diff --git a/ts/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.ts b/ts/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.ts index 0292294e..625b5834 100644 --- a/ts/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.ts +++ b/ts/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.ts @@ -18,4 +18,44 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(this.ptr); } } + public ChannelAnnouncement get_a() { + number ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(this.ptr); + const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public ChannelUpdate get_b() { + number ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(this.ptr); + const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public ChannelUpdate get_c() { + number ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(this.ptr); + const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public number clone_ptr() { + number ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(this.ptr); + return ret; + } + + public ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ clone() { + number ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(this.ptr); + ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public static ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ constructor_new(ChannelAnnouncement a, ChannelUpdate b, ChannelUpdate c) { + number ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a == null ? 0 : a.ptr & ~1, b == null ? 0 : b.ptr & ~1, c == null ? 0 : c.ptr & ~1); + ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + } diff --git a/ts/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.ts b/ts/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.ts index cdcd147a..e1a15644 100644 --- a/ts/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.ts +++ b/ts/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.ts @@ -18,4 +18,42 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(this.ptr); } } + public RawInvoice get_a() { + number ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(this.ptr); + const ret_hu_conv: RawInvoice = new RawInvoice(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public Uint8Array get_b() { + Uint8Array ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(this.ptr); + return ret; + } + + public InvoiceSignature get_c() { + number ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(this.ptr); + const ret_hu_conv: InvoiceSignature = new InvoiceSignature(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public number clone_ptr() { + number ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(this.ptr); + return ret; + } + + public ThreeTuple_RawInvoice_u832InvoiceSignatureZ clone() { + number ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(this.ptr); + ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + public static ThreeTuple_RawInvoice_u832InvoiceSignatureZ constructor_new(RawInvoice a, Uint8Array b, InvoiceSignature c) { + number ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a == null ? 0 : a.ptr & ~1, InternalUtils.check_arr_len(b, 32), c == null ? 0 : c.ptr & ~1); + ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + } diff --git a/ts/structs/TrustedClosingTransaction.ts b/ts/structs/TrustedClosingTransaction.ts index eb15abc1..a9aa05dd 100644 --- a/ts/structs/TrustedClosingTransaction.ts +++ b/ts/structs/TrustedClosingTransaction.ts @@ -29,7 +29,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public Uint8Array sign(Uint8Array funding_key, Uint8Array funding_redeemscript, number channel_value_satoshis) { - Uint8Array ret = bindings.TrustedClosingTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis); + Uint8Array ret = bindings.TrustedClosingTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis); return ret; } diff --git a/ts/structs/TrustedCommitmentTransaction.ts b/ts/structs/TrustedCommitmentTransaction.ts index 5448f12e..09248f42 100644 --- a/ts/structs/TrustedCommitmentTransaction.ts +++ b/ts/structs/TrustedCommitmentTransaction.ts @@ -38,7 +38,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public Result_CVec_SignatureZNoneZ get_htlc_sigs(Uint8Array htlc_base_key, DirectedChannelTransactionParameters channel_parameters) { - number ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, htlc_base_key, channel_parameters == null ? 0 : channel_parameters.ptr & ~1); + number ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr & ~1); Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); this.ptrs_to.add(channel_parameters); return ret_hu_conv; diff --git a/ts/structs/TwoTuple_BlockHashChannelManagerZ.ts b/ts/structs/TwoTuple_BlockHashChannelManagerZ.ts index 31156f91..d6c17cfe 100644 --- a/ts/structs/TwoTuple_BlockHashChannelManagerZ.ts +++ b/ts/structs/TwoTuple_BlockHashChannelManagerZ.ts @@ -31,7 +31,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static TwoTuple_BlockHashChannelManagerZ constructor_new(Uint8Array a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Logger b_logger, KeysInterface b_keys_manager, UserConfig b_config, ChainParameters b_params) { - number ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(a, bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_logger == null ? 0 : b_logger.ptr, b_keys_manager == null ? 0 : b_keys_manager.ptr, b_config == null ? 0 : b_config.ptr & ~1, b_params == null ? 0 : b_params.ptr & ~1)); + number ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_logger == null ? 0 : b_logger.ptr, b_keys_manager == null ? 0 : b_keys_manager.ptr, b_config == null ? 0 : b_config.ptr & ~1, b_params == null ? 0 : b_params.ptr & ~1)); TwoTuple_BlockHashChannelManagerZ ret_hu_conv = new TwoTuple_BlockHashChannelManagerZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(b_fee_est); diff --git a/ts/structs/TwoTuple_BlockHashChannelMonitorZ.ts b/ts/structs/TwoTuple_BlockHashChannelMonitorZ.ts index 7fbdcc75..e2efd8a8 100644 --- a/ts/structs/TwoTuple_BlockHashChannelMonitorZ.ts +++ b/ts/structs/TwoTuple_BlockHashChannelMonitorZ.ts @@ -30,6 +30,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.C2Tuple_BlockHashChannelMonitorZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_BlockHashChannelMonitorZ clone() { number ret = bindings.C2Tuple_BlockHashChannelMonitorZ_clone(this.ptr); TwoTuple_BlockHashChannelMonitorZ ret_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, ret); @@ -38,7 +43,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static TwoTuple_BlockHashChannelMonitorZ constructor_new(Uint8Array a, ChannelMonitor b) { - number ret = bindings.C2Tuple_BlockHashChannelMonitorZ_new(a, b == null ? 0 : b.ptr & ~1); + number ret = bindings.C2Tuple_BlockHashChannelMonitorZ_new(InternalUtils.check_arr_len(a, 32), b == null ? 0 : b.ptr & ~1); TwoTuple_BlockHashChannelMonitorZ ret_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/TwoTuple_OutPointScriptZ.ts b/ts/structs/TwoTuple_OutPointScriptZ.ts index 79499518..0a9dd35b 100644 --- a/ts/structs/TwoTuple_OutPointScriptZ.ts +++ b/ts/structs/TwoTuple_OutPointScriptZ.ts @@ -30,6 +30,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.C2Tuple_OutPointScriptZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_OutPointScriptZ clone() { number ret = bindings.C2Tuple_OutPointScriptZ_clone(this.ptr); TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret); diff --git a/ts/structs/TwoTuple_PaymentHashPaymentIdZ.ts b/ts/structs/TwoTuple_PaymentHashPaymentIdZ.ts index 5f4d48d5..645ca609 100644 --- a/ts/structs/TwoTuple_PaymentHashPaymentIdZ.ts +++ b/ts/structs/TwoTuple_PaymentHashPaymentIdZ.ts @@ -28,6 +28,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.C2Tuple_PaymentHashPaymentIdZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_PaymentHashPaymentIdZ clone() { number ret = bindings.C2Tuple_PaymentHashPaymentIdZ_clone(this.ptr); TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret); @@ -36,7 +41,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static TwoTuple_PaymentHashPaymentIdZ constructor_new(Uint8Array a, Uint8Array b) { - number ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(a, b); + number ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32)); TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.ts b/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.ts index 0948fad9..d0401208 100644 --- a/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.ts +++ b/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.ts @@ -28,6 +28,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_PaymentHashPaymentSecretZ clone() { number ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone(this.ptr); TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret); @@ -36,7 +41,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static TwoTuple_PaymentHashPaymentSecretZ constructor_new(Uint8Array a, Uint8Array b) { - number ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(a, b); + number ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32)); TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/TwoTuple_PublicKeyTypeZ.ts b/ts/structs/TwoTuple_PublicKeyTypeZ.ts index 211fbc13..c7c12671 100644 --- a/ts/structs/TwoTuple_PublicKeyTypeZ.ts +++ b/ts/structs/TwoTuple_PublicKeyTypeZ.ts @@ -30,6 +30,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.C2Tuple_PublicKeyTypeZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_PublicKeyTypeZ clone() { number ret = bindings.C2Tuple_PublicKeyTypeZ_clone(this.ptr); TwoTuple_PublicKeyTypeZ ret_hu_conv = new TwoTuple_PublicKeyTypeZ(null, ret); @@ -38,7 +43,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static TwoTuple_PublicKeyTypeZ constructor_new(Uint8Array a, Type b) { - number ret = bindings.C2Tuple_PublicKeyTypeZ_new(a, b == null ? 0 : b.ptr); + number ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b == null ? 0 : b.ptr); TwoTuple_PublicKeyTypeZ ret_hu_conv = new TwoTuple_PublicKeyTypeZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(b); diff --git a/ts/structs/TwoTuple_SignatureCVec_SignatureZZ.ts b/ts/structs/TwoTuple_SignatureCVec_SignatureZZ.ts index 40a8a0a7..ff23dea6 100644 --- a/ts/structs/TwoTuple_SignatureCVec_SignatureZZ.ts +++ b/ts/structs/TwoTuple_SignatureCVec_SignatureZZ.ts @@ -28,6 +28,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_SignatureCVec_SignatureZZ clone() { number ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_clone(this.ptr); TwoTuple_SignatureCVec_SignatureZZ ret_hu_conv = new TwoTuple_SignatureCVec_SignatureZZ(null, ret); @@ -36,7 +41,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static TwoTuple_SignatureCVec_SignatureZZ constructor_new(Uint8Array a, Uint8Array[] b) { - number ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_new(a, b); + number ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_new(InternalUtils.check_arr_len(a, 64), b != null ? Arrays.stream(b).map(b_conv_12 -> InternalUtils.check_arr_len(b_conv_12, 64)).toArray(Uint8Array[]::new) : null); TwoTuple_SignatureCVec_SignatureZZ ret_hu_conv = new TwoTuple_SignatureCVec_SignatureZZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.ts b/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.ts index 18b2bc67..28911f41 100644 --- a/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.ts +++ b/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.ts @@ -35,6 +35,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_conv_21_arr; } + public number clone_ptr() { + number ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ clone() { number ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(this.ptr); TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ(null, ret); @@ -43,7 +48,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ constructor_new(Uint8Array a, TwoTuple_u32ScriptZ[] b) { - number ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a, b != null ? Arrays.stream(b).map(b_conv_21 -> b_conv_21 != null ? b_conv_21.ptr : 0).toArray(number[]::new) : null); + number ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(InternalUtils.check_arr_len(a, 32), b != null ? Arrays.stream(b).map(b_conv_21 -> b_conv_21 != null ? b_conv_21.ptr : 0).toArray(number[]::new) : null); TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.ts b/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.ts index 61c7aec2..a18ddfe8 100644 --- a/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.ts +++ b/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.ts @@ -35,6 +35,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_conv_20_arr; } + public number clone_ptr() { + number ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ clone() { number ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(this.ptr); TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret); @@ -43,7 +48,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public static TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ constructor_new(Uint8Array a, TwoTuple_u32TxOutZ[] b) { - number ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a, b != null ? Arrays.stream(b).map(b_conv_20 -> b_conv_20 != null ? b_conv_20.ptr : 0).toArray(number[]::new) : null); + number ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(InternalUtils.check_arr_len(a, 32), b != null ? Arrays.stream(b).map(b_conv_20 -> b_conv_20 != null ? b_conv_20.ptr : 0).toArray(number[]::new) : null); TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; diff --git a/ts/structs/TwoTuple_u32ScriptZ.ts b/ts/structs/TwoTuple_u32ScriptZ.ts index bc15645b..3f10e6b1 100644 --- a/ts/structs/TwoTuple_u32ScriptZ.ts +++ b/ts/structs/TwoTuple_u32ScriptZ.ts @@ -28,6 +28,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.C2Tuple_u32ScriptZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_u32ScriptZ clone() { number ret = bindings.C2Tuple_u32ScriptZ_clone(this.ptr); TwoTuple_u32ScriptZ ret_hu_conv = new TwoTuple_u32ScriptZ(null, ret); diff --git a/ts/structs/TwoTuple_u32TxOutZ.ts b/ts/structs/TwoTuple_u32TxOutZ.ts index a5bf46aa..57927771 100644 --- a/ts/structs/TwoTuple_u32TxOutZ.ts +++ b/ts/structs/TwoTuple_u32TxOutZ.ts @@ -29,6 +29,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_conv; } + public number clone_ptr() { + number ret = bindings.C2Tuple_u32TxOutZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_u32TxOutZ clone() { number ret = bindings.C2Tuple_u32TxOutZ_clone(this.ptr); TwoTuple_u32TxOutZ ret_hu_conv = new TwoTuple_u32TxOutZ(null, ret); diff --git a/ts/structs/TwoTuple_usizeTransactionZ.ts b/ts/structs/TwoTuple_usizeTransactionZ.ts index 691679d5..c150b0a2 100644 --- a/ts/structs/TwoTuple_usizeTransactionZ.ts +++ b/ts/structs/TwoTuple_usizeTransactionZ.ts @@ -28,6 +28,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.C2Tuple_usizeTransactionZ_clone_ptr(this.ptr); + return ret; + } + public TwoTuple_usizeTransactionZ clone() { number ret = bindings.C2Tuple_usizeTransactionZ_clone(this.ptr); TwoTuple_usizeTransactionZ ret_hu_conv = new TwoTuple_usizeTransactionZ(null, ret); diff --git a/ts/structs/TxCreationKeys.ts b/ts/structs/TxCreationKeys.ts index e6af3f27..7cdad7a5 100644 --- a/ts/structs/TxCreationKeys.ts +++ b/ts/structs/TxCreationKeys.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_per_commitment_point(Uint8Array val) { - bindings.TxCreationKeys_set_per_commitment_point(this.ptr, val); + bindings.TxCreationKeys_set_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_revocation_key() { @@ -33,7 +33,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_revocation_key(Uint8Array val) { - bindings.TxCreationKeys_set_revocation_key(this.ptr, val); + bindings.TxCreationKeys_set_revocation_key(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_broadcaster_htlc_key() { @@ -42,7 +42,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_broadcaster_htlc_key(Uint8Array val) { - bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val); + bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_countersignatory_htlc_key() { @@ -51,7 +51,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_countersignatory_htlc_key(Uint8Array val) { - bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val); + bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_broadcaster_delayed_payment_key() { @@ -60,16 +60,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_broadcaster_delayed_payment_key(Uint8Array val) { - bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val); + bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, InternalUtils.check_arr_len(val, 33)); } public static TxCreationKeys constructor_new(Uint8Array per_commitment_point_arg, Uint8Array revocation_key_arg, Uint8Array broadcaster_htlc_key_arg, Uint8Array countersignatory_htlc_key_arg, Uint8Array broadcaster_delayed_payment_key_arg) { - number ret = bindings.TxCreationKeys_new(per_commitment_point_arg, revocation_key_arg, broadcaster_htlc_key_arg, countersignatory_htlc_key_arg, broadcaster_delayed_payment_key_arg); + number ret = bindings.TxCreationKeys_new(InternalUtils.check_arr_len(per_commitment_point_arg, 33), InternalUtils.check_arr_len(revocation_key_arg, 33), InternalUtils.check_arr_len(broadcaster_htlc_key_arg, 33), InternalUtils.check_arr_len(countersignatory_htlc_key_arg, 33), InternalUtils.check_arr_len(broadcaster_delayed_payment_key_arg, 33)); const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.TxCreationKeys_clone_ptr(this.ptr); + return ret; + } + public TxCreationKeys clone() { number ret = bindings.TxCreationKeys_clone(this.ptr); const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); @@ -89,13 +94,13 @@ import * as bindings from '../bindings' // TODO: figure out location } public static Result_TxCreationKeysErrorZ constructor_derive_new(Uint8Array per_commitment_point, Uint8Array broadcaster_delayed_payment_base, Uint8Array broadcaster_htlc_base, Uint8Array countersignatory_revocation_base, Uint8Array countersignatory_htlc_base) { - number ret = bindings.TxCreationKeys_derive_new(per_commitment_point, broadcaster_delayed_payment_base, broadcaster_htlc_base, countersignatory_revocation_base, countersignatory_htlc_base); + number ret = bindings.TxCreationKeys_derive_new(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(broadcaster_delayed_payment_base, 33), InternalUtils.check_arr_len(broadcaster_htlc_base, 33), InternalUtils.check_arr_len(countersignatory_revocation_base, 33), InternalUtils.check_arr_len(countersignatory_htlc_base, 33)); Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public static Result_TxCreationKeysErrorZ constructor_from_channel_static_keys(Uint8Array per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { - number ret = bindings.TxCreationKeys_from_channel_static_keys(per_commitment_point, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1); + number ret = bindings.TxCreationKeys_from_channel_static_keys(InternalUtils.check_arr_len(per_commitment_point, 33), broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1); Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(broadcaster_keys); ret_hu_conv.ptrs_to.add(countersignatory_keys); diff --git a/ts/structs/Type.ts b/ts/structs/Type.ts index 8441989f..fda6128e 100644 --- a/ts/structs/Type.ts +++ b/ts/structs/Type.ts @@ -78,6 +78,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } + public number clone_ptr() { + number ret = bindings.Type_clone_ptr(this.ptr); + return ret; + } + public Type clone() { number ret = bindings.Type_clone(this.ptr); Type ret_hu_conv = new Type(null, ret); diff --git a/ts/structs/UnsignedChannelAnnouncement.ts b/ts/structs/UnsignedChannelAnnouncement.ts index 34645a68..08981954 100644 --- a/ts/structs/UnsignedChannelAnnouncement.ts +++ b/ts/structs/UnsignedChannelAnnouncement.ts @@ -35,7 +35,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_chain_hash(Uint8Array val) { - bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_short_channel_id() { @@ -53,7 +53,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_node_id_1(Uint8Array val) { - bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_node_id_2() { @@ -62,7 +62,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_node_id_2(Uint8Array val) { - bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_bitcoin_key_1() { @@ -71,7 +71,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_bitcoin_key_1(Uint8Array val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_bitcoin_key_2() { @@ -80,7 +80,12 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_bitcoin_key_2(Uint8Array val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val); + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, InternalUtils.check_arr_len(val, 33)); + } + + public number clone_ptr() { + number ret = bindings.UnsignedChannelAnnouncement_clone_ptr(this.ptr); + return ret; } public UnsignedChannelAnnouncement clone() { diff --git a/ts/structs/UnsignedChannelUpdate.ts b/ts/structs/UnsignedChannelUpdate.ts index 4accac62..c509f73f 100644 --- a/ts/structs/UnsignedChannelUpdate.ts +++ b/ts/structs/UnsignedChannelUpdate.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_chain_hash(Uint8Array val) { - bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, val); + bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_short_channel_id() { @@ -90,6 +90,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val); } + public number clone_ptr() { + number ret = bindings.UnsignedChannelUpdate_clone_ptr(this.ptr); + return ret; + } + public UnsignedChannelUpdate clone() { number ret = bindings.UnsignedChannelUpdate_clone(this.ptr); const ret_hu_conv: UnsignedChannelUpdate = new UnsignedChannelUpdate(null, ret); diff --git a/ts/structs/UnsignedNodeAnnouncement.ts b/ts/structs/UnsignedNodeAnnouncement.ts index b64c4f85..dce96727 100644 --- a/ts/structs/UnsignedNodeAnnouncement.ts +++ b/ts/structs/UnsignedNodeAnnouncement.ts @@ -44,7 +44,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_node_id(Uint8Array val) { - bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val); + bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_rgb() { @@ -53,7 +53,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_rgb(Uint8Array val) { - bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val); + bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3)); } public Uint8Array get_alias() { @@ -62,13 +62,18 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_alias(Uint8Array val) { - bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val); + bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32)); } public void set_addresses(NetAddress[] val) { bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new) : null); } + public number clone_ptr() { + number ret = bindings.UnsignedNodeAnnouncement_clone_ptr(this.ptr); + return ret; + } + public UnsignedNodeAnnouncement clone() { number ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr); const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret); diff --git a/ts/structs/UpdateAddHTLC.ts b/ts/structs/UpdateAddHTLC.ts index e4506a6b..5622a5da 100644 --- a/ts/structs/UpdateAddHTLC.ts +++ b/ts/structs/UpdateAddHTLC.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.UpdateAddHTLC_set_channel_id(this.ptr, val); + bindings.UpdateAddHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_htlc_id() { @@ -51,7 +51,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_hash(Uint8Array val) { - bindings.UpdateAddHTLC_set_payment_hash(this.ptr, val); + bindings.UpdateAddHTLC_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_cltv_expiry() { @@ -63,6 +63,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val); } + public number clone_ptr() { + number ret = bindings.UpdateAddHTLC_clone_ptr(this.ptr); + return ret; + } + public UpdateAddHTLC clone() { number ret = bindings.UpdateAddHTLC_clone(this.ptr); const ret_hu_conv: UpdateAddHTLC = new UpdateAddHTLC(null, ret); diff --git a/ts/structs/UpdateFailHTLC.ts b/ts/structs/UpdateFailHTLC.ts index fcca5e86..afe36ae9 100644 --- a/ts/structs/UpdateFailHTLC.ts +++ b/ts/structs/UpdateFailHTLC.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.UpdateFailHTLC_set_channel_id(this.ptr, val); + bindings.UpdateFailHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_htlc_id() { @@ -36,6 +36,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val); } + public number clone_ptr() { + number ret = bindings.UpdateFailHTLC_clone_ptr(this.ptr); + return ret; + } + public UpdateFailHTLC clone() { number ret = bindings.UpdateFailHTLC_clone(this.ptr); const ret_hu_conv: UpdateFailHTLC = new UpdateFailHTLC(null, ret); diff --git a/ts/structs/UpdateFailMalformedHTLC.ts b/ts/structs/UpdateFailMalformedHTLC.ts index 6068882e..3b894fb1 100644 --- a/ts/structs/UpdateFailMalformedHTLC.ts +++ b/ts/structs/UpdateFailMalformedHTLC.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val); + bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_htlc_id() { @@ -45,6 +45,11 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val); } + public number clone_ptr() { + number ret = bindings.UpdateFailMalformedHTLC_clone_ptr(this.ptr); + return ret; + } + public UpdateFailMalformedHTLC clone() { number ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr); const ret_hu_conv: UpdateFailMalformedHTLC = new UpdateFailMalformedHTLC(null, ret); diff --git a/ts/structs/UpdateFee.ts b/ts/structs/UpdateFee.ts index 6ffed425..a86e5903 100644 --- a/ts/structs/UpdateFee.ts +++ b/ts/structs/UpdateFee.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.UpdateFee_set_channel_id(this.ptr, val); + bindings.UpdateFee_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_feerate_per_kw() { @@ -37,12 +37,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static UpdateFee constructor_new(Uint8Array channel_id_arg, number feerate_per_kw_arg) { - number ret = bindings.UpdateFee_new(channel_id_arg, feerate_per_kw_arg); + number ret = bindings.UpdateFee_new(InternalUtils.check_arr_len(channel_id_arg, 32), feerate_per_kw_arg); const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.UpdateFee_clone_ptr(this.ptr); + return ret; + } + public UpdateFee clone() { number ret = bindings.UpdateFee_clone(this.ptr); const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); diff --git a/ts/structs/UpdateFulfillHTLC.ts b/ts/structs/UpdateFulfillHTLC.ts index 02a0a7a5..5bd5d0b1 100644 --- a/ts/structs/UpdateFulfillHTLC.ts +++ b/ts/structs/UpdateFulfillHTLC.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_channel_id(Uint8Array val) { - bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, val); + bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_htlc_id() { @@ -42,16 +42,21 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_preimage(Uint8Array val) { - bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, val); + bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, InternalUtils.check_arr_len(val, 32)); } public static UpdateFulfillHTLC constructor_new(Uint8Array channel_id_arg, number htlc_id_arg, Uint8Array payment_preimage_arg) { - number ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg); + number ret = bindings.UpdateFulfillHTLC_new(InternalUtils.check_arr_len(channel_id_arg, 32), htlc_id_arg, InternalUtils.check_arr_len(payment_preimage_arg, 32)); const ret_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.UpdateFulfillHTLC_clone_ptr(this.ptr); + return ret; + } + public UpdateFulfillHTLC clone() { number ret = bindings.UpdateFulfillHTLC_clone(this.ptr); const ret_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, ret); diff --git a/ts/structs/UserConfig.ts b/ts/structs/UserConfig.ts index ed711c94..0cc921e6 100644 --- a/ts/structs/UserConfig.ts +++ b/ts/structs/UserConfig.ts @@ -67,6 +67,11 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.UserConfig_clone_ptr(this.ptr); + return ret; + } + public UserConfig clone() { number ret = bindings.UserConfig_clone(this.ptr); const ret_hu_conv: UserConfig = new UserConfig(null, ret); diff --git a/ts/structs/UtilMethods.ts b/ts/structs/UtilMethods.ts index 474fa406..17fcb276 100644 --- a/ts/structs/UtilMethods.ts +++ b/ts/structs/UtilMethods.ts @@ -1,5 +1,17 @@ + public static Result_COption_ClosureReasonZDecodeErrorZ constructor_ClosureReason_read(Uint8Array ser) { + number ret = bindings.ClosureReason_read(ser); + Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_COption_EventZDecodeErrorZ constructor_Event_read(Uint8Array ser) { + number ret = bindings.Event_read(ser); + Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + public static Result_StringErrorZ constructor_sign(Uint8Array msg, Uint8Array sk) { - number ret = bindings.sign(msg, sk); + number ret = bindings.sign(msg, InternalUtils.check_arr_len(sk, 32)); Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -11,10 +23,16 @@ } public static boolean constructor_verify(Uint8Array msg, String sig, Uint8Array pk) { - boolean ret = bindings.verify(msg, sig, pk); + boolean ret = bindings.verify(msg, sig, InternalUtils.check_arr_len(pk, 33)); return ret; } + public static Result_COption_MonitorEventZDecodeErrorZ constructor_MonitorEvent_read(Uint8Array ser) { + number ret = bindings.MonitorEvent_read(ser); + Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor_C2Tuple_BlockHashChannelMonitorZ_read(Uint8Array ser, KeysInterface arg) { number ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg == null ? 0 : arg.ptr); Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); @@ -36,7 +54,7 @@ } public static Uint8Array constructor_build_commitment_secret(Uint8Array commitment_seed, number idx) { - Uint8Array ret = bindings.build_commitment_secret(commitment_seed, idx); + Uint8Array ret = bindings.build_commitment_secret(InternalUtils.check_arr_len(commitment_seed, 32), idx); return ret; } @@ -46,31 +64,31 @@ } public static Result_SecretKeyErrorZ constructor_derive_private_key(Uint8Array per_commitment_point, Uint8Array base_secret) { - number ret = bindings.derive_private_key(per_commitment_point, base_secret); + number ret = bindings.derive_private_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_secret, 32)); Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public static Result_PublicKeyErrorZ constructor_derive_public_key(Uint8Array per_commitment_point, Uint8Array base_point) { - number ret = bindings.derive_public_key(per_commitment_point, base_point); + number ret = bindings.derive_public_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_point, 33)); Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public static Result_SecretKeyErrorZ constructor_derive_private_revocation_key(Uint8Array per_commitment_secret, Uint8Array countersignatory_revocation_base_secret) { - number ret = bindings.derive_private_revocation_key(per_commitment_secret, countersignatory_revocation_base_secret); + number ret = bindings.derive_private_revocation_key(InternalUtils.check_arr_len(per_commitment_secret, 32), InternalUtils.check_arr_len(countersignatory_revocation_base_secret, 32)); Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public static Result_PublicKeyErrorZ constructor_derive_public_revocation_key(Uint8Array per_commitment_point, Uint8Array countersignatory_revocation_base_point) { - number ret = bindings.derive_public_revocation_key(per_commitment_point, countersignatory_revocation_base_point); + number ret = bindings.derive_public_revocation_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(countersignatory_revocation_base_point, 33)); Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } public static Uint8Array constructor_get_revokeable_redeemscript(Uint8Array revocation_key, number contest_delay, Uint8Array broadcaster_delayed_payment_key) { - Uint8Array ret = bindings.get_revokeable_redeemscript(revocation_key, contest_delay, broadcaster_delayed_payment_key); + Uint8Array ret = bindings.get_revokeable_redeemscript(InternalUtils.check_arr_len(revocation_key, 33), contest_delay, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33)); return ret; } @@ -82,23 +100,29 @@ } public static Uint8Array constructor_make_funding_redeemscript(Uint8Array broadcaster, Uint8Array countersignatory) { - Uint8Array ret = bindings.make_funding_redeemscript(broadcaster, countersignatory); + Uint8Array ret = bindings.make_funding_redeemscript(InternalUtils.check_arr_len(broadcaster, 33), InternalUtils.check_arr_len(countersignatory, 33)); return ret; } public static Uint8Array constructor_build_htlc_transaction(Uint8Array commitment_txid, number feerate_per_kw, number contest_delay, HTLCOutputInCommitment htlc, Uint8Array broadcaster_delayed_payment_key, Uint8Array revocation_key) { - Uint8Array ret = bindings.build_htlc_transaction(commitment_txid, feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, broadcaster_delayed_payment_key, revocation_key); + Uint8Array ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33)); // this.ptrs_to.add(htlc); return ret; } public static number constructor_get_commitment_transaction_number_obscure_factor(Uint8Array broadcaster_payment_basepoint, Uint8Array countersignatory_payment_basepoint, boolean outbound_from_broadcaster) { - number ret = bindings.get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint, countersignatory_payment_basepoint, outbound_from_broadcaster); + number ret = bindings.get_commitment_transaction_number_obscure_factor(InternalUtils.check_arr_len(broadcaster_payment_basepoint, 33), InternalUtils.check_arr_len(countersignatory_payment_basepoint, 33), outbound_from_broadcaster); return ret; } + public static Result_COption_NetworkUpdateZDecodeErrorZ constructor_NetworkUpdate_read(Uint8Array ser) { + number ret = bindings.NetworkUpdate_read(ser); + Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + public static Result_RouteLightningErrorZ constructor_find_route(Uint8Array our_node_pubkey, RouteParameters params, NetworkGraph network, ChannelDetails[] first_hops, Logger logger, Score scorer) { - number ret = bindings.find_route(our_node_pubkey, params == null ? 0 : params.ptr & ~1, network == null ? 0 : network.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new) : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr); + number ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), params == null ? 0 : params.ptr & ~1, network == null ? 0 : network.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new) : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr); Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(params); ret_hu_conv.ptrs_to.add(network); diff --git a/ts/structs/Watch.ts b/ts/structs/Watch.ts index 5026f0b3..300d856e 100644 --- a/ts/structs/Watch.ts +++ b/ts/structs/Watch.ts @@ -38,7 +38,7 @@ import * as bindings from '../bindings' // TODO: figure out location const monitor_hu_conv: ChannelMonitor = new ChannelMonitor(null, monitor); monitor_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.watch_channel(funding_txo_hu_conv, monitor_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, @@ -48,13 +48,13 @@ import * as bindings from '../bindings' // TODO: figure out location const update_hu_conv: ChannelMonitorUpdate = new ChannelMonitorUpdate(null, update); update_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.update_channel(funding_txo_hu_conv, update_hu_conv); - result: number = ret != null ? ret.ptr : 0; + result: number = ret == null ? 0 : ret.clone_ptr(); return result; }, release_pending_monitor_events (): number[] { MonitorEvent[] ret = arg.release_pending_monitor_events(); - result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_14 -> ret_conv_14.ptr).toArray(number[]::new) : null; + result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_14 -> ret_conv_14 == null ? 0 : ret_conv_14.clone_ptr()).toArray(number[]::new) : null; return result; }, diff --git a/ts/structs/WatchedOutput.ts b/ts/structs/WatchedOutput.ts index 87aec961..8b3364c2 100644 --- a/ts/structs/WatchedOutput.ts +++ b/ts/structs/WatchedOutput.ts @@ -24,7 +24,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_block_hash(Uint8Array val) { - bindings.WatchedOutput_set_block_hash(this.ptr, val); + bindings.WatchedOutput_set_block_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } public OutPoint get_outpoint() { @@ -48,12 +48,17 @@ import * as bindings from '../bindings' // TODO: figure out location } public static WatchedOutput constructor_new(Uint8Array block_hash_arg, OutPoint outpoint_arg, Uint8Array script_pubkey_arg) { - number ret = bindings.WatchedOutput_new(block_hash_arg, outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg); + number ret = bindings.WatchedOutput_new(InternalUtils.check_arr_len(block_hash_arg, 32), outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg); const ret_hu_conv: WatchedOutput = new WatchedOutput(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } + public number clone_ptr() { + number ret = bindings.WatchedOutput_clone_ptr(this.ptr); + return ret; + } + public WatchedOutput clone() { number ret = bindings.WatchedOutput_clone(this.ptr); const ret_hu_conv: WatchedOutput = new WatchedOutput(null, ret); -- 2.30.2